Click or drag to resize
JsonObject Class
Represents a JSON object.
Inheritance Hierarchy

Namespace: Dextronet.Jsonie
Assembly: Dextronet.Jsonie (in Dextronet.Jsonie.dll) Version: 1.0.0.0
Syntax
public class JsonObject : JsonValue, IDictionary<string, JsonValue>

The JsonObject type exposes the following members.

Constructors
  NameDescription
Public methodJsonObject
Creates new empty JSON object.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of propeties contained in the object.
Public propertyIsEmpty
Tests if json object is empty (has no property defined).
Protected propertyIsReadOnly
Returns False.
Public propertyItem
Gets or sets the element with the specified key.
Public propertyKeys
Gets an ICollection(Of T) containing the keys of the object.
Public propertyValues
Gets an ICollection(Of T) containing the values in the object.
Top
Methods
  NameDescription
Protected methodAdd(KeyValuePairString, JsonValue)
Adds an item to the collection.
Public methodAdd(String, JsonValue)
Adds an member with the specified key and value to this object.
Protected methodCode exampleAddAndGetTJsonValue
Adds new member into object and returns added value (actually the passed parameter). This is handy for one-line adding and variable initalization:
Examples
Dim myArray = myObject.AddAndGet("array", new JsonArray())
Public methodAddArray
Adds an empty array member and returns its instance.
Public methodAddObject
Adds an empty object property and returns its instance.
Public methodClear
Removes all members from the object.
Protected methodContains
Determines whether the collection contains a specific value.
Public methodContainsKey
Tests whether the object contains a member with the specified key. It does not check the value of the member which might be null.
Public methodContainsKeyNotNull
Tests whether the object contains a member with the specified key and which is not null.
Public methodCopyTo
Copies the elements of the collection to an Array, starting at a particular Array index.
Public methodEquals(Object)
Determines whether current object is equal to another object.
(Overrides ObjectEquals(Object).)
Public methodEquals(JsonDynamic)
Determines whether current object is equal to another object.
Public methodEquals(JsonObject)
Determines whether current object is equal to another object.
Public methodGetEnumerator
Returns an enumerator that iterates through the object.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode.)
Public methodGetOrAddTJsonValue
Gets the member stored under given key and casts it to desired type. If key does not exist specified value is stored as a new member.
Public methodCode exampleGetOrAddArray
Gets value stored under given key and casts it to array. If key does not exist new empty array is added to the specified key.
Public methodCode exampleGetOrAddObject
Gets value stored under given key and casts it to object. If key does not exist new empty object is added to the specified key.
Public methodGetOrDefault(String, Boolean)
Gets value stored under given key and casts it to boolean. If not such member exists than defaultValue is returned.
Public methodGetOrDefault(String, Decimal)
Gets value stored under given key and casts it to decimal. If not such member exists than defaultValue is returned.
Public methodGetOrDefault(String, Double)
Gets value stored under given key and casts it to decimal. If not such member exists than defaultValue is returned.
Public methodGetOrDefault(String, Int32)
Gets value stored under given key and casts it to decimal. If not such member exists than defaultValue is returned.
Public methodGetOrDefault(String, Int64)
Gets value stored under given key and casts it to decimal. If not such member exists than defaultValue is returned.
Public methodGetOrDefault(String, Single)
Gets value stored under given key and casts it to decimal. If not such member exists than defaultValue is returned.
Public methodGetOrDefault(String, String)
Gets value stored under given key and casts it to String. If not such member exists than defaultValue is returned.
Public methodGetOrDefaultTJsonValue(String, TJsonValue)
Gets value stored under given key and casts it to desired type. If not such member exists than defaultValue is returned.
Protected methodRemove(KeyValuePairString, JsonValue)
Removes the first occurrence of a specific object from the collection.
Public methodRemove(String)
Removes the member with the specified key from the object.
Public methodTryGetValue
Gets the value associated with the specified key.
Top
Extension Methods
  NameDescription
Public Extension MethodAsArray
Casts (CType) value to JsonObject.
(Defined by JsonValueExtensions.)
Public Extension MethodAsBoolean
Casts (CType) value to JsonBool.
(Defined by JsonValueExtensions.)
Public Extension MethodAsNumber
Casts (CType) value to JsonNumber.
(Defined by JsonValueExtensions.)
Public Extension MethodAsObject
Casts (CType) value to JsonObject.
(Defined by JsonValueExtensions.)
Public Extension MethodAsString
Casts (CType) value to JsonString.
(Defined by JsonValueExtensions.)
Public Extension MethodToDynamic
Wraps given json value to dynamic type.
(Defined by JsonValueExtensions.)
Top
See Also