Assembly: RestSharp.Serializers.SimpleJson
Namespace: RestSharp
Class JsonArray
Represents the json array.
Inheritance
↳ object
↳ System.Collections.Generic.List<object>
Syntax
Constructor JsonArray()
Syntax
Constructor JsonArray(Int32)
Syntax
Parameters
| Name | Type | Description |
capacity | int | |
Method ToString()
The json representation of the array.
Syntax
Returns
| Type | Description |
string | The json representation of the array. |
Class JsonObject
Represents the json object.
Inheritance
↳ DynamicObject
↳ System.Object
Syntax
Constructor JsonObject()
Syntax
Constructor JsonObject(IEqualityComparer<String>)
Syntax
Parameters
| Name | Type | Description |
comparer | System.Collections.Generic.IEqualityComparer<string> | |
Property Item[Int32]
Syntax
Parameters
| Name | Type | Description |
index | int | |
Method Add(String, Object)
Adds the specified key.
Syntax
Parameters
| Name | Type | Description |
key | string | The key. |
value | object | The value. |
Method ContainsKey(String)
Determines whether the specified key contains key.
Syntax
Parameters
| Name | Type | Description |
key | string | The key. |
Returns
true if the specified key contains key; otherwise, false.
Property Keys
Gets the keys.
Syntax
Method Remove(String)
Removes the specified key.
Syntax
Parameters
| Name | Type | Description |
key | string | The key. |
Returns
Method TryGetValue(String, out Object)
Tries the get value.
Syntax
Parameters
| Name | Type | Description |
key | string | The key. |
value | object | The value. |
Returns
Property Values
Gets the values.
Syntax
Property Item[String]
Syntax
Parameters
| Name | Type | Description |
key | string | |
Method Add(KeyValuePair<String, Object>)
Adds the specified item.
Syntax
Parameters
| Name | Type | Description |
item | System.Collections.Generic.KeyValuePair<string, object> | The item. |
Method Clear()
Clears this instance.
Syntax
Method Contains(KeyValuePair<String, Object>)
Determines whether [contains] [the specified item].
Syntax
Parameters
| Name | Type | Description |
item | System.Collections.Generic.KeyValuePair<string, object> | The item. |
Returns
true if [contains] [the specified item]; otherwise, false.
Method CopyTo(KeyValuePair<String, Object>[], Int32)
Copies to.
Syntax
Parameters
| Name | Type | Description |
array | System.Collections.Generic.KeyValuePair<string, object>[] | The array. |
arrayIndex | int | Index of the array. |
Property Count
Gets the count.
Syntax
Property IsReadOnly
Gets a value indicating whether this instance is read only.
Syntax
Method Remove(KeyValuePair<String, Object>)
Removes the specified item.
Syntax
Parameters
| Name | Type | Description |
item | System.Collections.Generic.KeyValuePair<string, object> | The item. |
Returns
Method GetEnumerator()
Gets the enumerator.
Syntax
Returns
| Type | Description |
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> | |
Method IEnumerable.GetEnumerator()
Syntax
Returns
| Type | Description |
System.Collections.IEnumerator | |
Method ToString()
Syntax
Returns
Method TryConvert(ConvertBinder, out Object)
Syntax
Parameters
| Name | Type | Description |
binder | ConvertBinder | |
result | object | |
Returns
Method TryDeleteMember(DeleteMemberBinder)
Provides the implementation for operations that delete an object member. This method is not intended for use in C# or Visual Basic.
Syntax
Parameters
| Name | Type | Description |
binder | DeleteMemberBinder | Provides information about the deletion. |
Returns
Alwasy returns true.
Method TryGetIndex(GetIndexBinder, Object[], out Object)
Syntax
Parameters
| Name | Type | Description |
binder | GetIndexBinder | |
indexes | object[] | |
result | object | |
Returns
Method TryGetMember(GetMemberBinder, out Object)
Syntax
Parameters
| Name | Type | Description |
binder | GetMemberBinder | |
result | object | |
Returns
Method TrySetIndex(SetIndexBinder, Object[], Object)
Syntax
Parameters
| Name | Type | Description |
binder | SetIndexBinder | |
indexes | object[] | |
value | object | |
Returns
Method TrySetMember(SetMemberBinder, Object)
Syntax
Parameters
| Name | Type | Description |
binder | SetMemberBinder | |
value | object | |
Returns
Method GetDynamicMemberNames()
Returns the enumeration of all dynamic member names.
Syntax
Returns
| Type | Description |
System.Collections.Generic.IEnumerable<string> | |
A sequence that contains dynamic member names.
Class SimpleJson
This class encodes and decodes JSON strings.
Spec. details, see http://www.json.org/
JSON uses Arrays and Objects. These correspond here to the datatypes JsonArray(IList<object>) and JsonObject(IDictionary<string,object>).
All numbers are parsed to doubles.
Inheritance
↳ object
Syntax
Method DeserializeObject(String)
Parses the string json into a value
Syntax
Parameters
| Name | Type | Description |
json | string | A JSON string. |
Returns
| Type | Description |
object | An IList<object>, a IDictionary<string,object>, a double, a string, null, true, or false |
Method DeserializeObject(Char[])
Parses the char array json into a value
Syntax
Parameters
| Name | Type | Description |
json | char[] | A JSON char array. |
Returns
| Type | Description |
object | An IList<object>, a IDictionary<string,object>, a double, a string, null, true, or false |
Method TryDeserializeObject(Char[], out Object)
Try parsing the json string into a value.
Syntax
Parameters
| Name | Type | Description |
json | char[] | |
A JSON string.
obj | object |
The object.
Returns
Returns true if successfull otherwise false.
Method TryDeserializeObject(String, out Object)
Try parsing the json string into a value.
Syntax
Parameters
| Name | Type | Description |
json | string | |
A JSON string.
obj | object |
The object.
Returns
Returns true if successfull otherwise false.
Method DeserializeObject(String, Type, IJsonSerializerStrategy)
Syntax
Parameters
| Name | Type | Description |
json | string | |
type | System.Type | |
jsonSerializerStrategy | RestSharp.IJsonSerializerStrategy | |
Returns
Method DeserializeObject(Char[], Type, IJsonSerializerStrategy)
Syntax
Parameters
| Name | Type | Description |
json | char[] | |
type | System.Type | |
jsonSerializerStrategy | RestSharp.IJsonSerializerStrategy | |
Returns
Method DeserializeObject(String, Type)
Syntax
Parameters
| Name | Type | Description |
json | string | |
type | System.Type | |
Returns
Method DeserializeObject<T>(String, IJsonSerializerStrategy)
Syntax
Generic parameters
Parameters
| Name | Type | Description |
json | string | |
jsonSerializerStrategy | RestSharp.IJsonSerializerStrategy | |
Returns
Method DeserializeObject<T>(String)
Syntax
Generic parameters
Parameters
| Name | Type | Description |
json | string | |
Returns
Method SerializeObject(Object, IJsonSerializerStrategy)
Converts a IDictionary<string,object> / IList<object> object into a JSON string
Syntax
Parameters
| Name | Type | Description |
json | object | A IDictionary<string,object> / IList<object> |
jsonSerializerStrategy | RestSharp.IJsonSerializerStrategy | Serializer strategy to use |
Returns
| Type | Description |
string | A JSON encoded string, or null if object 'json' is not serializable |
Method SerializeObject(Object)
Syntax
Parameters
| Name | Type | Description |
json | object | |
Returns
Method EscapeToJavascriptString(String)
Syntax
Parameters
| Name | Type | Description |
jsonString | string | |
Returns
Property CurrentJsonSerializerStrategy
Syntax
Property PocoJsonSerializerStrategy
Syntax
Interface IJsonSerializerStrategy
Syntax
Method TrySerializeNonPrimitiveObject(Object, out Object)
Syntax
Parameters
| Name | Type | Description |
input | object | |
output | object | |
Returns
Method DeserializeObject(Object, Type)
Syntax
Parameters
| Name | Type | Description |
value | object | |
type | System.Type | |
Returns
Class PocoJsonSerializerStrategy
Inheritance
↳ object
Syntax
Constructor PocoJsonSerializerStrategy()
Syntax
Method MapClrMemberNameToJsonFieldName(String)
Syntax
Parameters
| Name | Type | Description |
clrFieldName | string | |
Returns
Method TrySerializeNonPrimitiveObject(Object, out Object)
Syntax
Parameters
| Name | Type | Description |
input | object | |
output | object | |
Returns
Method DeserializeObject(Object, Type)
Syntax
Parameters
| Name | Type | Description |
value | object | |
type | System.Type | |
Returns
Method SerializeEnum(Enum)
Syntax
Parameters
| Name | Type | Description |
p | System.Enum | |
Returns
Method TrySerializeKnownTypes(Object, out Object)
Syntax
Parameters
| Name | Type | Description |
input | object | |
output | object | |
Returns
Method TrySerializeUnknownTypes(Object, out Object)
Syntax
Parameters
| Name | Type | Description |
input | object | |
output | object | |
Returns