Show / Hide Table of Contents

Class JsonObject

Represents a collection of key:value pairs in a JSON structure.

Inheritance
System.Object
System.Collections.Generic.Dictionary<System.String, JsonValue>
JsonObject
Implements
System.Collections.Generic.IDictionary<System.String, JsonValue>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, JsonValue>>
System.Collections.Generic.IReadOnlyDictionary<System.String, JsonValue>
System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<System.String, JsonValue>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, JsonValue>>
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.IEnumerable
System.Runtime.Serialization.IDeserializationCallback
System.Runtime.Serialization.ISerializable
Inherited Members
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.get_Item(System.Object)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.set_Item(System.Object, System.Object)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Add(System.String, Manatee.Json.JsonValue)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Clear()
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.ContainsKey(System.String)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.ContainsValue(Manatee.Json.JsonValue)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.GetEnumerator()
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.OnDeserialization(System.Object)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Remove(System.String)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>>.Add(System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>>.Contains(System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>>.CopyTo(System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>[], System.Int32)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>>.Remove(System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>>.GetEnumerator()
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.Add(System.Object, System.Object)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.Contains(System.Object)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.GetEnumerator()
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.Remove(System.Object)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.TryGetValue(System.String, Manatee.Json.JsonValue)
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Comparer
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Count
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Item[System.String]
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Keys
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Manatee.Json.JsonValue>>.IsReadOnly
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.IDictionary<System.String, Manatee.Json.JsonValue>.Keys
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.IDictionary<System.String, Manatee.Json.JsonValue>.Values
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.IReadOnlyDictionary<System.String, Manatee.Json.JsonValue>.Keys
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.Generic.IReadOnlyDictionary<System.String, Manatee.Json.JsonValue>.Values
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.ICollection.IsSynchronized
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.ICollection.SyncRoot
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.IsFixedSize
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.IsReadOnly
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.Item[System.Object]
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.Keys
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.System.Collections.IDictionary.Values
System.Collections.Generic.Dictionary<System.String, Manatee.Json.JsonValue>.Values
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Manatee.Json
Assembly: Manatee.Json.dll
Syntax
public class JsonObject : Dictionary<string, JsonValue>, IDictionary<string, JsonValue>, ICollection<KeyValuePair<string, JsonValue>>, IReadOnlyDictionary<string, JsonValue>, IReadOnlyCollection<KeyValuePair<string, JsonValue>>, IEnumerable<KeyValuePair<string, JsonValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable
Remarks

A key is always represented as a string. A value can consist of a string, a numerical value, a boolean (true or false), a null placeholder, a JSON array of values, or a nested JSON object.

Constructors

| Improve this Doc View Source

JsonObject()

Creates an empty instance of a JSON object.

Declaration
public JsonObject()
| Improve this Doc View Source

JsonObject(IDictionary<String, Nullable<JsonValue>>)

Creates an instance of a JSON object and initializes it with the supplied JSON values.

Declaration
public JsonObject(IDictionary<string, JsonValue? > collection)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.Nullable<JsonValue>> collection

Properties

| Improve this Doc View Source

Item[String]

Gets or sets the value associated with the specified key.

Declaration
public JsonValue this[string key] { get; set; }
Parameters
Type Name Description
System.String key

The key of the value to get or set.

Property Value
Type Description
JsonValue

The value associated with the specified key.

Methods

| Improve this Doc View Source

Add(String, Nullable<JsonValue>)

Adds the specified key and value to the dictionary.

Declaration
public void Add(string key, JsonValue? value)
Parameters
Type Name Description
System.String key

The key of the element to add.

System.Nullable<JsonValue> value

The value of the element to add. If the value is null, it will be replaced by Null.

| Improve this Doc View Source

Equals(Nullable<Object>)

Determines whether the specified System.Object is equal to the current System.Object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj

The System.Object to compare with the current System.Object.

Returns
Type Description
System.Boolean

true if the specified System.Object is equal to the current System.Object; otherwise, false.

| Improve this Doc View Source

GetHashCode()

Serves as a hash function for a particular type.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for the current System.Object.

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

GetIndentedString(Int32)

Creates a string representation of the JSON data.

Declaration
public string GetIndentedString(int indentLevel = 0)
Parameters
Type Name Description
System.Int32 indentLevel

The indention level for the object.

Returns
Type Description
System.String

A string.

| Improve this Doc View Source

ToString()

Creates a string representation of the JSON data.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string.

Overrides
System.Object.ToString()
Remarks

Passing the returned string back into the parser will result in a copy of this JSON object.

Implements

System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.IEnumerable
System.Runtime.Serialization.IDeserializationCallback
System.Runtime.Serialization.ISerializable

Extension Methods

JsonObjectExtensions.TryGetString(JsonObject, String)
JsonObjectExtensions.TryGetNumber(JsonObject, String)
JsonObjectExtensions.TryGetBoolean(JsonObject, String)
JsonObjectExtensions.TryGetArray(JsonObject, String)
JsonObjectExtensions.TryGetObject(JsonObject, String)
LinqExtensions.ToJson<T>(IEnumerable<KeyValuePair<String, T>>, JsonSerializer)
LinqExtensions.ToJson<T>(IEnumerable<KeyValuePair<String, T>>, JsonSerializer)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX