mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
feat: Adding AppendPropertyRaw method to ReprStringBuilder
This commit is contained in:
@@ -13,7 +13,7 @@ namespace ICD.Common.Utils
|
|||||||
private readonly object m_Instance;
|
private readonly object m_Instance;
|
||||||
|
|
||||||
private readonly List<string> m_PropertyOrder;
|
private readonly List<string> m_PropertyOrder;
|
||||||
private readonly Dictionary<string, object> m_PropertyValues;
|
private readonly Dictionary<string, string> m_PropertyValues;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
@@ -24,11 +24,11 @@ namespace ICD.Common.Utils
|
|||||||
m_Instance = instance;
|
m_Instance = instance;
|
||||||
|
|
||||||
m_PropertyOrder = new List<string>();
|
m_PropertyOrder = new List<string>();
|
||||||
m_PropertyValues = new Dictionary<string, object>();
|
m_PropertyValues = new Dictionary<string, string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the property with the given name and value to the
|
/// Adds the property with the given name and value to the builder.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
@@ -37,6 +37,21 @@ namespace ICD.Common.Utils
|
|||||||
m_PropertyOrder.Remove(name);
|
m_PropertyOrder.Remove(name);
|
||||||
m_PropertyOrder.Add(name);
|
m_PropertyOrder.Add(name);
|
||||||
|
|
||||||
|
string valueString = GetValueStringRepresentation(value);
|
||||||
|
|
||||||
|
m_PropertyValues[name] = valueString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the property with the given name and value to the builder without any additonal formatting.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
public void AppendPropertyRaw(string name, string value)
|
||||||
|
{
|
||||||
|
m_PropertyOrder.Remove(name);
|
||||||
|
m_PropertyOrder.Add(name);
|
||||||
|
|
||||||
m_PropertyValues[name] = value;
|
m_PropertyValues[name] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +75,7 @@ namespace ICD.Common.Utils
|
|||||||
builder.Append(property);
|
builder.Append(property);
|
||||||
builder.Append('=');
|
builder.Append('=');
|
||||||
|
|
||||||
object value = m_PropertyValues[property];
|
string valueString = m_PropertyValues[property];
|
||||||
string valueString = GetValueStringRepresentation(value);
|
|
||||||
builder.Append(valueString);
|
builder.Append(valueString);
|
||||||
|
|
||||||
if (index < m_PropertyOrder.Count - 1)
|
if (index < m_PropertyOrder.Count - 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user