namespace TeamCity.MSBuild.Logger { using System.Collections.Generic; using JetBrains.Annotations; using JetBrains.TeamCity.ServiceMessages; internal class PatchedServiceMessage : IServiceMessage { [NotNull] private readonly IServiceMessage _message; [NotNull] private readonly Dictionary _values = new Dictionary(); public PatchedServiceMessage([NotNull] IServiceMessage message) { _message = message; foreach (var key in _message.Keys) { _values[key] = message.GetValue(key); } } public string GetValue(string key) => _values.TryGetValue(key, out var value) ? value : default; public string Name => _message.Name; public string DefaultValue => _message.DefaultValue; public IEnumerable Keys => _values.Keys; public void Add(string name, string value) => _values[name] = value; } }