Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

JsonValue Class

This is the abstract base class for JavaScript Object Notation (JSON) common language runtime (CLR) types.

Namespace:  System.Json
Assembly:  System.Json (in System.Json.dll)
'Declaration
<DefaultMemberAttribute("Item")> _
Public MustInherit Class JsonValue _
	Implements IEnumerable

The JsonValue type exposes the following members.

  NameDescription
Public propertyCountThis method is not supported and throws an exception when called.
Public propertyItem(Int32)This indexer is not supported for this base class and throws an exception.
Public propertyItem(String)This indexer is not supported for this base class and throws an exception.
Public propertyJsonTypeWhen implemented in a derived class, indicates the JSON CLR type represented by the derived type.
Top
  NameDescription
Public methodContainsKeyThrows an InvalidOperationException.
Public methodEquals(Object)Determines 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 the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberLoad(Stream)Deserializes text-based JSON from a stream into a JSON CLR type.
Public methodStatic memberLoad(TextReader)Deserializes text-based JSON from a text reader into a JSON CLR type.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberParseDeserializes text-based JSON into a JSON CLR type.
Public methodSave(Stream)When implemented in a derived class, serializes the JsonValue CLR type into text-based JSON using a stream.
Public methodSave(TextWriter)Serializes the JsonValue CLR type into text-based JSON using a text writer.
Public methodToStringSaves (serializes) this JSON CLR type into text-based JSON. (Overrides Object.ToString.)
Top
  NameDescription
Public operatorStatic memberWidening(Boolean to JsonValue)Enables implicit casts from type Boolean to a JsonPrimitive.
Public operatorStatic memberWidening(Byte to JsonValue)Enables implicit casts from type Byte to a JsonPrimitive.
Public operatorStatic memberWidening(Char to JsonValue)Enables implicit casts from type Char to a JsonPrimitive.
Public operatorStatic memberWidening(DateTime to JsonValue)Enables implicit casts from type DateTime to a JsonPrimitive.
Public operatorStatic memberWidening(DateTimeOffset to JsonValue)Enables implicit casts from type DateTimeOffset to a JsonObject.
Public operatorStatic memberWidening(Decimal to JsonValue)Enables implicit casts from type Decimal to a JsonPrimitive.
Public operatorStatic memberWidening(Double to JsonValue)Enables implicit casts from type Double to a JsonPrimitive.
Public operatorStatic memberWidening(Guid to JsonValue)Enables implicit casts from type Guid to a JsonPrimitive.
Public operatorStatic memberWidening(Int16 to JsonValue)Enables implicit casts from type Int16 to a JsonPrimitive.
Public operatorStatic memberWidening(Int32 to JsonValue)Enables implicit casts from type Int32 to a JsonPrimitive.
Public operatorStatic memberWidening(Int64 to JsonValue)Enables implicit casts from type Int64 to a JsonPrimitive.
Public operatorStatic memberWidening(JsonValue to DateTime)Enables implicit casts from an instance of type JsonValue to a Datetime object.
Public operatorStatic memberWidening(JsonValue to TimeSpan)Enables implicit casts from an instance of type JsonValue to a TimeSpan object.
Public operatorStatic memberWidening(JsonValue to Boolean)Enables implicit casts from an instance of type JsonValue to a Boolean object.
Public operatorStatic memberWidening(JsonValue to Char)Enables implicit casts from an instance of type JsonValue to a Char object.
Public operatorStatic memberWidening(JsonValue to Int64)Enables implicit casts from an instance of type JsonValue to a Int64 object.
Public operatorStatic memberWidening(JsonValue to Decimal)Enables implicit casts from an instance of type JsonValue to a Decimal object.
Public operatorStatic memberWidening(JsonValue to Int32)Enables implicit casts from an instance of type JsonValue to a Int32 object.
Public operatorStatic memberWidening(JsonValue to UInt64)Enables implicit casts from an instance of type JsonValue to a UInt64 object.
Public operatorStatic memberWidening(JsonValue to String)Enables implicit casts from an instance of type JsonValue to a String object.
Public operatorStatic memberWidening(JsonValue to DateTimeOffset)Enables implicit casts from an instance of type JsonValue to a DateTimeOffset object.
Public operatorStatic memberWidening(JsonValue to Single)Enables implicit casts from an instance of type JsonValue to a Single object.
Public operatorStatic memberWidening(JsonValue to Double)Enables implicit casts from an instance of type JsonValue to a Double object.
Public operatorStatic memberWidening(JsonValue to SByte)Enables implicit casts from an instance of type JsonValue to a SByte object.
Public operatorStatic memberWidening(JsonValue to Byte)Enables implicit casts from an instance of type JsonValue to a Byte object.
Public operatorStatic memberWidening(JsonValue to Uri)Enables implicit casts from an instance of type JsonValue to a Uri object.
Public operatorStatic memberWidening(JsonValue to UInt16)Enables implicit casts from an instance of type JsonValue to a UInt16 object.
Public operatorStatic memberWidening(JsonValue to UInt32)Enables implicit casts from an instance of type JsonValue to a UInt32 object.
Public operatorStatic memberWidening(JsonValue to Int16)Enables implicit casts from an instance of type JsonValue to a Int16 object.
Public operatorStatic memberWidening(JsonValue to Guid)Enables implicit casts from an instance of type JsonValue to a Guid object.
Public operatorStatic memberWidening(SByte to JsonValue)Enables implicit casts from type SByte to a JsonPrimitive.
Public operatorStatic memberWidening(Single to JsonValue)Enables implicit casts from type Single to a JsonPrimitive.
Public operatorStatic memberWidening(String to JsonValue)Enables implicit casts from type String to a JsonPrimitive.
Public operatorStatic memberWidening(TimeSpan to JsonValue)Enables implicit casts from type Timespan to a JsonPrimitive.
Public operatorStatic memberWidening(UInt16 to JsonValue)Enables implicit casts from type UInt16 to a JsonPrimitive.
Public operatorStatic memberWidening(UInt32 to JsonValue)Enables implicit casts from type UInt32 to a JsonPrimitive.
Public operatorStatic memberWidening(UInt64 to JsonValue)Enables implicit casts from type UInt64 to a JsonPrimitive.
Public operatorStatic memberWidening(Uri to JsonValue)Enables implicit casts from type Uri to a JsonPrimitive.
Top
  NameDescription
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodCast(Of TResult)Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodOfType(Of TResult)Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top
  NameDescription
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorThis method is not supported for this base class and throws an exception.
Top

The JSON CLR types JsonPrimitive, JsonArray, and JsonObject all inherit from this base class. It contains functionality common to all JSON CLR types, which is accessed through abstract methods and inheritance from this type. In particular, it contains a set of Implicit operations that supports implicit static type conversion that enables you to treat JSON in a weakly typed manner.

Note that you cannot create custom classes that derive from JsonValue because one of its abstract properties is internal. This means that only types like JsonPrimitive that are in the System.Json.dll are allowed to derive from the class.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.