/// <summary> /// Initializes a new instance of the <see cref="KVObject"/> class. /// </summary> /// <param name="name">Name of this object.</param> /// <param name="value">Value of this object.</param> public KVObject(string name, KVValue value) { Require.NotNull(name, nameof(name)); Require.NotNull(value, nameof(value)); Name = name; Value = value; }
public void Set(string name, KVValue value) { Require.NotNull(name, nameof(name)); Require.NotNull(value, nameof(value)); children.RemoveAll(kv => kv.Name == name); children.Add(new KVObject(name, value)); }
void WriteKeyValuePair(string name, KVValue value) { WriteIndentation(); WriteText(name); writer.Write('\t'); WriteText((string)value); WriteLine(); }
public void SetValue(KVValue value) => CurrentObject.Value = value;