Class NewtonsoftStringTypeConverter
OptimaJet.Workflow.Core.Designer.NewtonsoftStringTypeConverter
Provides a JsonConverter that serializes and deserializes Type values as URL-encoded friendly type names.
Namespace: OptimaJet.Workflow.Core.Designer
public class NewtonsoftStringTypeConverter : JsonConverterType Hierarchy
- JsonConverter
- NewtonsoftStringTypeConverter Current type
Methods
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) #Writes a Type as a URL-encoded friendly type name.
Parameters
Example
Serializing
typeof(System.Collections.Generic.Dictionary<string, int>) writes the JSON string "System.Collections.Generic.Dictionary%3CString%2CInt32%3E".public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) #Reads a URL-encoded friendly type name and resolves it to a Type.
Parameters
Name
Type
Description
readerJsonReaderThe JsonReader that provides the JSON value.
objectTypeTypeThe type of the object being deserialized.
existingValueObjectThe existing value of the object being deserialized.
serializerJsonSerializerThe JsonSerializer for the deserialization operation.
Returns
Exceptions
Type
Description
TypeParsingExceptionThe JSON value cannot be decoded or resolved to a Type.
Example
Reading the JSON string
"System.Collections.Generic.Dictionary%3CString%2CInt32%3E" returns typeof(System.Collections.Generic.Dictionary<string, int>).