Esempio n. 1
0
        // We will be working with one if this class' children - object or array - so we need to
        // use the add method that's appropriate for that child
        private void AddSelector(string key, JsonBaseType value)
        {
            JsonArray thisArray = this as JsonArray;

            if (thisArray != null)
            {
                thisArray.Add(value);
            }
            else
            {
                ((JsonObject)this).Add(key, value);
            }
        }
Esempio n. 2
0
 // Implement the correct add method for an array
 internal void Add(JsonBaseType value)
 {
     ((List <JsonBaseType>)InternalValue).Add(value);
 }
Esempio n. 3
0
 // Implement the correct add method for an object (dictionary)
 internal void Add(string key, JsonBaseType value)
 {
     ((Dictionary <string, JsonBaseType>)InternalValue).Add(key, value);
 }