Class JsonValue
Inheritance
System.Object
JsonValue
Implements
System.ICloneable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Subsembly.Json.dll
Syntax
public class JsonValue : ICloneable
Constructors
JsonValue(Boolean)
Declaration
Parameters
Type |
Name |
Description |
System.Boolean |
f |
|
JsonValue(Decimal)
Declaration
public JsonValue(decimal n)
Parameters
Type |
Name |
Description |
System.Decimal |
n |
|
JsonValue(Double)
Declaration
public JsonValue(double n)
Parameters
Type |
Name |
Description |
System.Double |
n |
|
JsonValue(Int32)
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
n |
|
JsonValue(Int64)
Declaration
Parameters
Type |
Name |
Description |
System.Int64 |
n |
|
JsonValue(Single)
Declaration
public JsonValue(float n)
Parameters
Type |
Name |
Description |
System.Single |
n |
|
JsonValue(String)
Declaration
public JsonValue(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
Fields
Null
Declaration
public static readonly JsonValue Null
Field Value
Undefined
Declaration
public static readonly JsonValue Undefined
Field Value
Properties
Item[Int32]
Access to the indexed elements of a JSON array.
Declaration
public JsonValue this[int nIndex] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
nIndex |
|
Property Value
Exceptions
Type |
Condition |
JsonTypeException |
Thrown is this is not an Array.
|
System.ArgumentOutOfRangeException |
An attempt was made to set a value with an index outside of the range of the array.
It is not possible to grow an array just by setting values outside of the current
range of values.
|
Item[String]
Access to the named properties of a JSON object.
Declaration
public JsonValue this[string sName] { get; set; }
Parameters
Type |
Name |
Description |
System.String |
sName |
Name of property, or path to a nested property seperated with dots.
|
Property Value
Exceptions
Type |
Condition |
System.ArgumentNullException |
The index sName was null .
|
JsonTypeException |
Thrown if this is not an Object.
|
JsonType
Declaration
public JsonType JsonType { get; }
Property Value
Value
Declaration
public object Value { get; }
Property Value
Type |
Description |
System.Object |
|
ValueAsBoolean
Declaration
public bool ValueAsBoolean { get; }
Property Value
Type |
Description |
System.Boolean |
|
ValueAsNumber
Declaration
public double ValueAsNumber { get; }
Property Value
Type |
Description |
System.Double |
|
ValueAsString
Returns the value as a string.
Declaration
public string ValueAsString { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Clone()
Declaration
Returns
Type |
Description |
System.Object |
|
Load(Stream)
Declaration
public static JsonValue Load(Stream aStream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
aStream |
|
Returns
Load(TextReader)
Declaration
public static JsonValue Load(TextReader aTextReader)
Parameters
Type |
Name |
Description |
System.IO.TextReader |
aTextReader |
|
Returns
Load(String)
Declaration
public static JsonValue Load(string sFileName)
Parameters
Type |
Name |
Description |
System.String |
sFileName |
|
Returns
Parse(Byte[])
Declaration
public static JsonValue Parse(byte[] vbJson)
Parameters
Type |
Name |
Description |
System.Byte[] |
vbJson |
|
Returns
Parse(String)
Declaration
public static JsonValue Parse(string sJson)
Parameters
Type |
Name |
Description |
System.String |
sJson |
|
Returns
Save(Stream)
Declaration
public void Save(Stream aStream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
aStream |
|
Save(TextWriter)
Declaration
public void Save(TextWriter aTextWriter)
Parameters
Type |
Name |
Description |
System.IO.TextWriter |
aTextWriter |
|
Save(String)
Declaration
public void Save(string sFileName)
Parameters
Type |
Name |
Description |
System.String |
sFileName |
|
ToByteArray()
Declaration
public byte[] ToByteArray()
Returns
Type |
Description |
System.Byte[] |
|
ToString()
Converts this value into its JSON string representation.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Operators
Implicit(JsonValue to Boolean)
Declaration
public static implicit operator bool (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implicit(JsonValue to Decimal)
Declaration
public static implicit operator decimal (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.Decimal |
|
Implicit(JsonValue to Double)
Declaration
public static implicit operator double (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.Double |
|
Implicit(JsonValue to Int32)
Declaration
public static implicit operator int (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Implicit(JsonValue to Int64)
Declaration
public static implicit operator long (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.Int64 |
|
Implicit(JsonValue to Single)
Declaration
public static implicit operator float (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.Single |
|
Implicit(JsonValue to String)
Declaration
public static implicit operator string (JsonValue aValue)
Parameters
Returns
Type |
Description |
System.String |
|
Implicit(Boolean to JsonValue)
Declaration
public static implicit operator JsonValue(bool f)
Parameters
Type |
Name |
Description |
System.Boolean |
f |
|
Returns
Implicit(Decimal to JsonValue)
Declaration
public static implicit operator JsonValue(decimal n)
Parameters
Type |
Name |
Description |
System.Decimal |
n |
|
Returns
Implicit(Double to JsonValue)
Declaration
public static implicit operator JsonValue(double n)
Parameters
Type |
Name |
Description |
System.Double |
n |
|
Returns
Implicit(Int32 to JsonValue)
Declaration
public static implicit operator JsonValue(int n)
Parameters
Type |
Name |
Description |
System.Int32 |
n |
|
Returns
Implicit(Int64 to JsonValue)
Declaration
public static implicit operator JsonValue(long n)
Parameters
Type |
Name |
Description |
System.Int64 |
n |
|
Returns
Implicit(Single to JsonValue)
Declaration
public static implicit operator JsonValue(float n)
Parameters
Type |
Name |
Description |
System.Single |
n |
|
Returns
Implicit(String to JsonValue)
Declaration
public static implicit operator JsonValue(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
Returns
Implements
System.ICloneable