Class JsonArray
Inheritance
System.Object
JsonArray
Implements
System.ICloneable
System.Collections.Generic.IEnumerable<
JsonValue>
System.Collections.ICollection
System.Collections.IEnumerable
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 JsonArray : JsonValue, ICloneable, IEnumerable<JsonValue>, ICollection, IEnumerable
Constructors
JsonArray()
Declaration
JsonArray(IList<JsonValue>)
Creates a new JsonArray using a given collection.
Declaration
public JsonArray(IList<JsonValue> aValue)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<JsonValue> |
aValue |
Collection of values. This must not be null . If this collection is read-only
then methods like Add(JsonValue) will not work.
|
JsonArray(String[])
Creates a new JsonArray initialized with the given string array.
Declaration
public JsonArray(string[] vsValues)
Parameters
Type |
Name |
Description |
System.String[] |
vsValues |
Array of strings that will be added to the newly created array.
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
Value
Declaration
public IList<JsonValue> Value { get; }
Property Value
Type |
Description |
System.Collections.Generic.IList<JsonValue> |
|
Methods
Add(JsonValue)
Add another JSON data element to the end of this array.
Declaration
public void Add(JsonValue aValue)
Parameters
AddRange(IEnumerable<JsonValue>)
Declaration
public void AddRange(IEnumerable<JsonValue> vJsonValues)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<JsonValue> |
vJsonValues |
|
OnAfterParseArray()
This is called by the JSON parser after this array object was fully parsed. It can
be used as a hook to validate the data, or to prepare a cache.
Declaration
protected virtual void OnAfterParseArray()
OnCreateChildArray(Int32)
This is called whenever the JSON parser needs a child array object for this object.
Declaration
protected virtual JsonArray OnCreateChildArray(int nIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
nIndex |
The index position at which a child array object is needed.
|
Returns
OnCreateChildObject(Int32)
This is called whenever the JSON parser needs a child object for this array.
Declaration
protected virtual JsonObject OnCreateChildObject(int nIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
nIndex |
The index position at which a child object is needed.
|
Returns
Parse(Byte[])
Declaration
public static JsonArray Parse(byte[] vbJson)
Parameters
Type |
Name |
Description |
System.Byte[] |
vbJson |
|
Returns
Parse(String)
Declaration
public static JsonArray Parse(string sJson)
Parameters
Type |
Name |
Description |
System.String |
sJson |
|
Returns
ParseJson(Byte[])
Parse the given vbJson
data, adding all its objects and values
to this array.
Declaration
public void ParseJson(byte[] vbJson)
Parameters
Type |
Name |
Description |
System.Byte[] |
vbJson |
The JSON to be parsed. If this is is null , then this method does nothing.
|
ParseJson(String)
Parse the given sJson
string, adding all its objects and values
to this array.
Declaration
public void ParseJson(string sJson)
Parameters
Type |
Name |
Description |
System.String |
sJson |
The JSON to be parsed. If this is is null or an empty string, then this
method does nothing.
|
ToArray<T>()
Declaration
public T[] ToArray<T>()
where T : JsonValue
Returns
Type Parameters
ToStringArray()
Declaration
public string[] ToStringArray()
Returns
Type |
Description |
System.String[] |
|
Explicit Interface Implementations
IEnumerable<JsonValue>.GetEnumerator()
Declaration
IEnumerator<JsonValue> IEnumerable<JsonValue>.GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<JsonValue> |
|
ICollection.CopyTo(Array, Int32)
Declaration
void ICollection.CopyTo(Array v, int i)
Parameters
Type |
Name |
Description |
System.Array |
v |
|
System.Int32 |
i |
|
ICollection.IsSynchronized
Declaration
bool ICollection.IsSynchronized { get; }
Returns
Type |
Description |
System.Boolean |
|
ICollection.SyncRoot
Declaration
object ICollection.SyncRoot { get; }
Returns
Type |
Description |
System.Object |
|
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
Implements
System.ICloneable
System.Collections.Generic.IEnumerable<T>
System.Collections.ICollection
System.Collections.IEnumerable