Esempio n. 1
0
        void Add(string key, JsonValue value)
        {
            if (key == null)
                throw new NullReferenceException("key");

            if (ContainsKey(key) == true)
                throw new JsonException(string.Format("Key '{0}' already exists in JsonObject", key));

            _value.Add(key, value);
        }
Esempio n. 2
0
        /// <summary>
        /// Method used to attempt to get a value from this Object
        /// </summary>
        /// <param name="key">The proposed key</param>
        /// <param name="value">The value to retrieve it to</param>
        /// <returns>True if successful, false otherwise.</returns>
        public bool TryGetValue(string key, out JsonValue value)
        {
            value = null;

            if (key == null)
                throw new NullReferenceException("key");

            if (this.ContainsKey(key) == false)
                return false;

            value = this[key];

            return true;
        }
Esempio n. 3
0
 private void Add(JsonValue jsonValue)
 {
     _items.Add(jsonValue);
 }