コード例 #1
0
        /// <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;
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 void WriteKeyValuePair(string name, KVValue value)
 {
     WriteIndentation();
     WriteText(name);
     writer.Write('\t');
     WriteText((string)value);
     WriteLine();
 }
コード例 #4
0
 public void SetValue(KVValue value) => CurrentObject.Value = value;