Class CloudConverter
- Namespace
- Glitch9.IO.Networking
Provides methods to convert objects to and from cloud-storable formats.
public static class CloudConverter
- Inheritance
-
CloudConverter
- Inherited Members
Properties
Logger
Sets the logger to output logs.
public static ILogger Logger { get; set; }
Property Value
Methods
GetConverter(Type)
Retrieves the converter for the specified type.
public static ICloudConverter GetConverter(Type type)
Parameters
typeTypeThe type for which to retrieve the converter.
Returns
- ICloudConverter
The converter for the specified type, or null if no converter is found.
RegisterGenericConverter<T>(CloudConverter<T>)
Registers a generic converter for the specified type.
public static void RegisterGenericConverter<T>(CloudConverter<T> converter)
Parameters
converterCloudConverter<T>The converter instance.
Type Parameters
TThe type to be converted.
ToCloudFormat(Type, object)
Converts the given property value to the cloud format.
public static object ToCloudFormat(Type type, object propertyValue)
Parameters
Returns
- object
The converted value in cloud format.
ToLocalFormat(Type, string, object)
Converts the given property value to the local format.
public static object ToLocalFormat(Type type, string propertyName, object propertyValue)
Parameters
typeTypeThe type of the property.
propertyNamestringThe name of the property.
propertyValueobjectThe value of the property.
Returns
- object
The converted value in local format.