Tip
See the Remarks section of the JsonValue type for more details and examples.
[SerializableAttribute]
public sealed class JsonArray : IList<JsonValue>,
ICollection<JsonValue>, IEnumerable<JsonValue>, IEnumerable<SerializableAttribute>
Public NotInheritable Class JsonArray
Implements IList(Of JsonValue), ICollection(Of JsonValue),
IEnumerable(Of JsonValue), IEnumerable[SerializableAttribute]
public ref class JsonArray sealed : IList<JsonValue>,
ICollection<JsonValue>, IEnumerable<JsonValue>, IEnumerable[<SealedAttribute>]
[<SerializableAttribute>]
type JsonArray =
class
interface IList<JsonValue>
interface ICollection<JsonValue>
interface IEnumerable<JsonValue>
interface IEnumerable
endJust like in JavaScript, the ToString (and WriteTo) methods replace Undefined values with Null.
Obtaining an element by the indexer using an invalid index returns Undefined, which is also a JavaScript-compatible behavior.
| JsonArray | Initializes a new instance of the JsonArray class. |
| JsonArray(IEnumerableJsonValue) | Initializes a new instance of the JsonArray class from a collection of JsonValue items. |
| Item | Gets or sets the element at the specified index. When the indexer is read, using an invalid index returns Undefined, just like in JavaScript. |
| Length | Gets the number of elements contained in the JsonArray. |
| Add | Adds an item to the JsonArray. |
| Clear | Removes all items from the JsonArray. |
| Contains | Determines whether the JsonArray contains the specific item. |
| CopyTo | Copies the elements of the JsonArray to an Array of JsonValue elements, starting at the specified arrayIndex. |
| Equals |
Determines whether the specified Object is equal to this instance. This method performs a deep comparison.
Allows comparing also to JsonValue instances with Array Type.
(Overrides ObjectEquals(Object)) |
| GetEnumerator | Returns an enumerator that iterates through the JsonArray. |
| GetHashCode |
Returns a hash code for this JsonArray instance.
(Overrides ObjectGetHashCode) |
| IndexOf | Determines the index of a specific value in the JsonArray. |
| Insert | Inserts an item to the JsonArray at the specified index. |
| Parse(String) | Reads a JsonArray from a string that contains JSON array. |
| Parse(TextReader) | Reads a JsonArray from a TextReader that contains a JSON array. |
| Parse(Stream, Encoding) | Reads a JsonArray from a Stream that contains JSON array. |
| Remove | Removes the first occurrence of the specific item from the JsonArray. |
| RemoveAt | Removes the value from the JsonArray at the specified index. |
| ToString |
Returns a minimized JSON string that represents this JsonArray.
(Overrides ObjectToString) |
| ToString(String) | Returns a JSON string that represents this JsonArray. |
| TryParse(String, JsonArray) | Tries to read a JsonArray from a string that contains JSON array. |
| TryParse(TextReader, JsonArray) | Tries to read a JsonArray from a TextReader that contains JSON array. |
| TryParse(Stream, JsonArray, Encoding) | Tries to read a JsonArray from a Stream that contains JSON array. |
| WriteTo(StringBuilder, String) | Writes this JsonArray instance into a JsonArray. |
| WriteTo(TextWriter, String) | Writes this JsonArray instance into a TextReader. |
| WriteTo(Stream, Encoding, String) | Writes this JsonArray instance into a Stream using the specified encoding. |