C# Class ConoHaNet.Services.Compute.IPAddressDetailsConverter

This implementation of JsonConverter allows for JSON serialization and deserialization of IPAddress objects in the "address details" format used by operations such as IComputeProvider.ListAddresses and IComputeProvider.ListAddressesByNetwork.
Inheritance: Newtonsoft.Json.JsonConverter
Afficher le fichier Open project: crowdy/OpenStack-ConoHa

Méthodes publiques

Méthode Description
CanConvert ( Type objectType ) : bool
ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object Deserialization is performed by deserializing the JSON value as an AddressDetails object, following by using IPAddress.Parse to convert the value of AddressDetails.Address to an IPAddress instance.
WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void Serialization is performed by creating an AddressDetails instance equivalent to the given IPAddress instance and serializing that as a JSON object.

Method Details

CanConvert() public méthode

public CanConvert ( Type objectType ) : bool
objectType System.Type
Résultat bool

ReadJson() public méthode

Deserialization is performed by deserializing the JSON value as an AddressDetails object, following by using IPAddress.Parse to convert the value of AddressDetails.Address to an IPAddress instance.
public ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
reader Newtonsoft.Json.JsonReader
objectType System.Type
existingValue object
serializer Newtonsoft.Json.JsonSerializer
Résultat object

WriteJson() public méthode

Serialization is performed by creating an AddressDetails instance equivalent to the given IPAddress instance and serializing that as a JSON object.
public WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void
writer Newtonsoft.Json.JsonWriter
value object
serializer Newtonsoft.Json.JsonSerializer
Résultat void