diff --git a/ICD.Common.Utils/ReprBuilder.cs b/ICD.Common.Utils/ReprBuilder.cs index 481feae..7ebaae2 100644 --- a/ICD.Common.Utils/ReprBuilder.cs +++ b/ICD.Common.Utils/ReprBuilder.cs @@ -13,7 +13,7 @@ namespace ICD.Common.Utils private readonly object m_Instance; private readonly List m_PropertyOrder; - private readonly Dictionary m_PropertyValues; + private readonly Dictionary m_PropertyValues; /// /// Constructor. @@ -24,11 +24,11 @@ namespace ICD.Common.Utils m_Instance = instance; m_PropertyOrder = new List(); - m_PropertyValues = new Dictionary(); + m_PropertyValues = new Dictionary(); } /// - /// Adds the property with the given name and value to the + /// Adds the property with the given name and value to the builder. /// /// /// @@ -37,6 +37,21 @@ namespace ICD.Common.Utils m_PropertyOrder.Remove(name); m_PropertyOrder.Add(name); + string valueString = GetValueStringRepresentation(value); + + m_PropertyValues[name] = valueString; + } + + /// + /// Adds the property with the given name and value to the builder without any additonal formatting. + /// + /// + /// + public void AppendPropertyRaw(string name, string value) + { + m_PropertyOrder.Remove(name); + m_PropertyOrder.Add(name); + m_PropertyValues[name] = value; } @@ -60,8 +75,7 @@ namespace ICD.Common.Utils builder.Append(property); builder.Append('='); - object value = m_PropertyValues[property]; - string valueString = GetValueStringRepresentation(value); + string valueString = m_PropertyValues[property]; builder.Append(valueString); if (index < m_PropertyOrder.Count - 1)