Class StringOrArrayConverter<T>
You must register each StringOrArray<T> converter with the JSON serializer.
Inherited Members
JsonConverter.CanRead
JsonConverter.CanWrite
Namespace: Glitch9.IO.Networking
Assembly: Glitch9.IO.dll
Syntax
public class StringOrArrayConverter<T> : JsonConverter<StringOrArray<T>>
Type Parameters
| Name | Description |
|---|---|
| T |
Methods
| Edit this page View SourceReadJson(JsonReader, Type, StringOrArray<T>, bool, JsonSerializer)
Reads the JSON representation of the object.
Declaration
public override StringOrArray<T> ReadJson(JsonReader reader, Type objectType, StringOrArray<T> existingValue, bool hasExistingValue, JsonSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | The Newtonsoft.Json.JsonReader to read from. |
| Type | objectType | Type of the object. |
| StringOrArray<T> | existingValue | The existing value of object being read. If there is no existing value then |
| bool | hasExistingValue | The existing value has a value. |
| JsonSerializer | serializer | The calling serializer. |
Returns
| Type | Description |
|---|---|
| StringOrArray<T> | The object value. |
Overrides
| Edit this page View SourceWriteJson(JsonWriter, StringOrArray<T>, JsonSerializer)
Writes the JSON representation of the object.
Declaration
public override void WriteJson(JsonWriter writer, StringOrArray<T> value, JsonSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonWriter | writer | The Newtonsoft.Json.JsonWriter to write to. |
| StringOrArray<T> | value | The value. |
| JsonSerializer | serializer | The calling serializer. |