Export (0) Print
Expand All

JsonPrimitive Class

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

Represents a JavaScript Object Notation (JSON) primitive type in the common language runtime (CLR).

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

[DataContractAttribute]
public sealed class JsonPrimitive : JsonValue

The JsonPrimitive type exposes the following members.

  NameDescription
Public methodJsonPrimitive(Boolean)Initializes a new instance of the JsonPrimitive class with a specified Boolean type.
Public methodJsonPrimitive(Byte)Initializes a new instance of the JsonPrimitive class with the specified Byte type.
Public methodJsonPrimitive(Char)Initializes a new instance of the JsonPrimitive class with the specified Char type.
Public methodJsonPrimitive(DateTime)Initializes a new instance of the JsonPrimitive class with a specified DateTime type.
Public methodJsonPrimitive(DateTimeOffset)Initializes a new instance of the JsonPrimitive class with a specified DateTimeOffset type.
Public methodJsonPrimitive(Decimal)Initializes a new instance of the JsonPrimitive class with a specified Decimal type.
Public methodJsonPrimitive(Double)Initializes a new instance of the JsonPrimitive class with a specified Double type.
Public methodJsonPrimitive(Guid)Initializes a new instance of the JsonPrimitive class with a specified Guid type.
Public methodJsonPrimitive(Int16)Initializes a new instance of the JsonPrimitive class with a specified Int16 type.
Public methodJsonPrimitive(Int32)Initializes a new instance of the JsonPrimitive class with a specified Int32 type.
Public methodJsonPrimitive(Int64)Initializes a new instance of the JsonPrimitive class with a specified Int64 type.
Public methodJsonPrimitive(SByte)Initializes a new instance of the JsonPrimitive class with a specified SByte type.
Public methodJsonPrimitive(Single)Initializes a new instance of the JsonPrimitive class with a specified Single type.
Public methodJsonPrimitive(String)Initializes a new instance of the JsonPrimitive class with a specified String type.
Public methodJsonPrimitive(UInt16)Initializes a new instance of the JsonPrimitive class with a specified UInt16 type.
Public methodJsonPrimitive(UInt32)Initializes a new instance of the JsonPrimitive class with a specified UInt32 type.
Public methodJsonPrimitive(UInt64)Initializes a new instance of the JsonPrimitive class with a specified UInt64 type.
Public methodJsonPrimitive(Uri)Initializes a new instance of the JsonPrimitive class with a specified Uri type.
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 Json values. (Inherited from JsonValue.)
Public propertyItem[Int32]Gets or sets the JsonValue object with specified index. (Inherited from JsonValue.)
Public propertyItem[String]Gets or sets the JsonValue object with specified key. (Inherited from JsonValue.)
Public propertyJsonTypeGets the JsonType that is associated with this JsonPrimitive object. (Overrides JsonValue.JsonType.)
Public propertyValueGets the value of the specified JsonPrimitive object.
Top

  NameDescription
Public methodAsDynamicReturns the Json value as a dynamic object. (Inherited from JsonValue.)
Public methodContainsKeyThrows an InvalidOperationException. (Inherited from JsonValue.)
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 specified JsonPrimitive as type. (Overrides JsonValue.ReadAs(Type).)
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 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 methodStatic memberTryCreateCreates a new JsonPrimitive using the specified object instance.
Public methodTryReadAs(Type, Object)Indicates whether the specified object reads as type. (Overrides JsonValue.TryReadAs(Type, Object).)
Public methodTryReadAs<T>(T)Indicates whether the JsonValue tries to read as a generic type. (Inherited from JsonValue.)
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.)
Public methodValueOrDefault(String)Specifies the value or the default value of the Json object with specified key. (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 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 methodIEnumerable.GetEnumeratorGets the JsonValue enumerator. (Inherited from JsonValue.)
Explicit interface implemetationPrivate methodIDynamicMetaObjectProvider.GetMetaObjectGets the JsonValue meta object. (Inherited from JsonValue.)
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