Export (0) Print
Expand All

JsonObject Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a Json object.

Namespace:  System.Json
Assembly:  System.Json (in System.Json.dll)

[DataContractAttribute]
public sealed class JsonObject : JsonValue, 
	IDictionary<string, JsonValue>, ICollection<KeyValuePair<string, JsonValue>>, 
	IEnumerable<KeyValuePair<string, JsonValue>>, IEnumerable

The JsonObject type exposes the following members.

  NameDescription
Public methodJsonObject(IEnumerable<KeyValuePair<String, JsonValue>>)Initializes a new instance of the JsonObject class using items.
Public methodJsonObject(KeyValuePair<String, JsonValue>[])Initializes a new instance of the JsonObject class using items.
Top

  NameDescription
Protected propertyChangedListenersCountGets the number of the changed listeners. (Inherited from JsonValue.)
Protected propertyChangingListenersCountGets the number of the changing listeners. (Inherited from JsonValue.)
Public propertyCountGets the number of key/value pairs in the JsonObject. (Overrides JsonValue.Count.)
Public propertyItem[String]Gets or sets an indexer used to look up a key/value pair based on a specified key. (Overrides JsonValue.Item[String].)
Public propertyItem[Int32]Gets or sets the JsonValue object with specified index. (Inherited from JsonValue.)
Public propertyJsonTypeGets the JSON type of the JsonObject. (Overrides JsonValue.JsonType.)
Public propertyKeysGets a collection that contains the keys in the JsonObject.
Public propertyValuesGets the collection that contains the values in the JsonObject.
Top

  NameDescription
Public methodAdd(KeyValuePair<String, JsonValue>)Adds a key/value pair to the JSON CLR object.
Public methodAdd(String, JsonValue)Adds a key/value pair to the JSON CLR object type.
Public methodAddRange(IEnumerable<KeyValuePair<String, JsonValue>>)Adds a specified of key/value pairs to the current instance of the JsonObject.
Public methodAddRange(KeyValuePair<String, JsonValue>[])Adds a specified array of key/value pairs to the current instance of JsonObject.
Public methodAsDynamicReturns the Json value as a dynamic object. (Inherited from JsonValue.)
Public methodClearRemoves all key/value pairs from the JSON CLR object.
Public methodContainsKeyChecks whether a key/value pair with a specified key exists in the JSON CLR object type. (Overrides JsonValue.ContainsKey(String).)
Public methodCopyToCopies the contents of the JSON CLR object into a specified key/value destination array beginning at a specified index.
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that can iterate through the JsonValue. (Inherited from JsonValue.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Protected methodGetKeyValuePairEnumeratorGets the key value pair enumerator for the JsonValue. (Inherited from JsonValue.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValue(Int32)Gets the Json value with specified index. (Inherited from JsonValue.)
Public methodGetValue(String)Gets the Json value with specified key. (Inherited from JsonValue.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnSaveEndedOccurs when the save is ended. (Inherited from JsonValue.)
Protected methodOnSaveStartedOccurs when the save is started. (Inherited from JsonValue.)
Protected methodRaiseChangedEventRaises the Changed event. (Inherited from JsonValue.)
Protected methodRaiseChangingEventRaises the Changing event. (Inherited from JsonValue.)
Public methodReadAs(Type)Reads the Jsonvalue with specified type. (Inherited from JsonValue.)
Public methodReadAs(Type, Object)Reads the Jsonvalue with specified type. (Inherited from JsonValue.)
Public methodReadAs<T>()Reads the JsonValue as an object. (Inherited from JsonValue.)
Public methodReadAs<T>(T)Reads the JsonValue as an object with specified fallback. (Inherited from JsonValue.)
Public methodRemoveRemoves the key/value pair with a specified from the JSON CLR object type.
Public methodSave(Stream)Serializes the JsonValue CLR type into text-based JSON using a stream. (Inherited from JsonValue.)
Public methodSave(TextWriter)Serializes the JsonValue CLR type into text-based JSON using a text writer. (Inherited from JsonValue.)
Public methodSetValue(Int32, Object)Sets the Json value with specified index and value. (Inherited from JsonValue.)
Public methodSetValue(String, Object)Sets the Json value with specified key and value. (Inherited from JsonValue.)
Public methodToStringSaves (serializes) this JSON CLR type into text-based JSON. (Inherited from JsonValue.)
Public methodTryGetValueAttempts to get the value that corresponds to the specified key.
Public methodTryReadAs(Type, Object)Indicates whether the JsonValue tries to read as type. (Inherited from JsonValue.)
Public methodTryReadAs<T>(T)Indicates whether the JsonValue tries to read as a generic type. (Inherited from JsonValue.)
Public methodValueOrDefault(String)Specifies the value or the default value of the Json object with specified key. (Overrides JsonValue.ValueOrDefault(String).)
Public methodValueOrDefault(Int32)Specifies the value or the default value of the Json object with specified index. (Inherited from JsonValue.)
Public methodValueOrDefault(Object[])Specifies the value or the default value of the Json object with specified indexes. (Inherited from JsonValue.)
Top

  NameDescription
Public eventChangedOccurs when the Json Value is changed. (Inherited from JsonValue.)
Public eventChangingOccurs when the Json Value is changing. (Inherited from JsonValue.)
Top

  NameDescription
Public Extension MethodReadAsType(Type)Overloaded. Reads the JsonValueExtensions as a type with specified value. (Defined by JsonValueExtensions.)
Public Extension MethodReadAsType<T>()Overloaded. Reads the JsonValueExtensions as an object. (Defined by JsonValueExtensions.)
Public Extension MethodReadAsType<T>(T)Overloaded. Reads the JsonValueExtensions as an object with specified fallback. (Defined by JsonValueExtensions.)
Public Extension MethodToJsonObjectConverts the specified items to Json object. (Defined by JsonValueLinqExtensions.)
Public Extension MethodTryReadAsType(Type, Object)Overloaded. Tries to read the JsonValueExtensions as a type. (Defined by JsonValueExtensions.)
Public Extension MethodTryReadAsType<T>(T)Overloaded. Tries to read the JsonValueExtensions as a generic type. (Defined by JsonValueExtensions.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection<KeyValuePair<String, JsonValue>>.ContainsChecks whether the JsonObject contains a specified key/value pair.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through the key/value pairs in the JsonObject.
Explicit interface implemetationPrivate methodIDynamicMetaObjectProvider.GetMetaObjectGets the JsonValue meta object. (Inherited from JsonValue.)
Explicit interface implemetationPrivate propertyICollection<KeyValuePair<String, JsonValue>>.IsReadOnlyGets a value that indicates whether this JSON CLR object is read-only.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<String, JsonValue>>.RemoveRemoves the first occurrence of a specified key/value pair from the JsonObject.
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft