Class JsonObject
Represents the json object.
Inheritance
Namespace: SimpleJson
Assembly: FunctionMonkey.Compiler.MSBuild.dll
Syntax
public class JsonObject : IDictionary<string, object>
Constructors
| Improve this Doc View SourceJsonObject()
Initializes a new instance of JsonObject.
Declaration
public JsonObject()
JsonObject(IEqualityComparer<String>)
Initializes a new instance of JsonObject.
Declaration
public JsonObject(IEqualityComparer<string> comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| IEqualityComparer<System.String> | comparer | The System.Collections.Generic.IEqualityComparer`1 implementation to use when comparing keys, or null to use the default System.Collections.Generic.EqualityComparer`1 for the type of the key. |
Properties
| Improve this Doc View SourceCount
Gets the count.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The count. |
IsReadOnly
Gets a value indicating whether this instance is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Item[Int32]
Gets the
Declaration
public object this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Property Value
| Type | Description |
|---|---|
| System.Object |
Item[String]
Gets or sets the
Declaration
public object this[string key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key |
Property Value
| Type | Description |
|---|---|
| System.Object |
Keys
Gets the keys.
Declaration
public ICollection<string> Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<System.String> | The keys. |
Values
Gets the values.
Declaration
public ICollection<object> Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<System.Object> | The values. |
Methods
| Improve this Doc View SourceAdd(KeyValuePair<String, Object>)
Adds the specified item.
Declaration
public void Add(KeyValuePair<string, object> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<System.String, System.Object> | item | The item. |
Add(String, Object)
Adds the specified key.
Declaration
public void Add(string key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key. |
| System.Object | value | The value. |
Clear()
Clears this instance.
Declaration
public void Clear()
Contains(KeyValuePair<String, Object>)
Determines whether [contains] [the specified item].
Declaration
public bool Contains(KeyValuePair<string, object> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<System.String, System.Object> | item | The item. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
ContainsKey(String)
Determines whether the specified key contains key.
Declaration
public bool ContainsKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
CopyTo(KeyValuePair<String, Object>[], Int32)
Copies to.
Declaration
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<System.String, System.Object>[] | array | The array. |
| System.Int32 | arrayIndex | Index of the array. |
GetEnumerator()
Gets the enumerator.
Declaration
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<System.String, System.Object>> |
Remove(KeyValuePair<String, Object>)
Removes the specified item.
Declaration
public bool Remove(KeyValuePair<string, object> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<System.String, System.Object> | item | The item. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remove(String)
Removes the specified key.
Declaration
public bool Remove(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ToString()
Returns a json System.String that represents the current System.Object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A json System.String that represents the current System.Object. |
TryGetValue(String, out Object)
Tries the get value.
Declaration
public bool TryGetValue(string key, out object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key. |
| System.Object | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Boolean |