Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Interface: RT.Serialization.IClassifyFormat<TElement>

Summary

Used by Classify to serialize and deserialize objects. Implement this to enable serialization to a new format.

Generic type parameters

TElement Type of the serialized form of an object or any sub-object.

Instance methods

TElement
FormatDictionary(IEnumerable<KeyValuePair<object, TElement>> values)
Generates an element that represents a dictionary. (see also remarks)
TElement
FormatKeyValuePair(TElement key, TElement value)
Generates an element that represents a key-value pair. (see also remarks)
TElement
FormatList(bool isTuple, IEnumerable<TElement> values)
Generates an element that represents a list. (see also remarks)
TElement Generates an element that represents a null value. (see also remarks)
TElement
FormatObject(IEnumerable<ObjectFieldInfo<TElement>> fields)
Generates an element that represents an object with fields. (see also remarks)
TElement
FormatRawData(byte[] value)
Generates an element that represents raw data (byte[]). (see also remarks)
TElement
FormatReferable(TElement element, int refId)
Converts an existing element (which may represent, for example, an object, list or dictionary) into one that can be referred to by a reference (see IClassifyFormat<TElement>.FormatReference(int)). (see also remarks)
TElement
FormatReference(int refId)
Generates an element that represents a reference to another object within the same serialized object graph. (see also remarks)
TElement
FormatSelfValue(TElement value)
Generates an element that represents a value of the same type as serialized elements. (see also remarks)
TElement
FormatSimpleValue(object value)
Generates an element that represents a byte, sbyte, short, ushort, int, uint, long, ulong, BigInteger, decimal, float, double, bool, char, string, DateTime or an enum value. (see also remarks)
TElement
FormatWithType(TElement element, string type, bool isFullType)
Converts an existing element (which may represent, for example, an object, list or dictionary) into one that additionally knows its type. (see also remarks)
IEnumerable<KeyValuePair<object, TElement>>
GetDictionary(TElement element)
Decodes a dictionary. (see also remarks)
TElement
GetField(TElement element, string fieldName, string declaringType)
Returns the sub-element pertaining to the specified field. (see also remarks)
void
GetKeyValuePair(TElement element, out TElement key, out TElement value)
Decodes a key-value pair. (see also remarks)
IEnumerable<TElement>
GetList(TElement element, int? tupleSize)
Decodes a list. (see also remarks)
byte[]
GetRawData(TElement element)
Decodes a piece of raw data. (see also remarks)
int
GetReferenceID(TElement element)
Returns the ID encoded in this element. This is called only if IClassifyFormat<TElement>.IsReference(TElement) or IClassifyFormat<TElement>.IsReferable(TElement) returned true. (see also remarks)
TElement
GetSelfValue(TElement element)
Decodes the serialized form of the element type itself. (see also remarks)
object
GetSimpleValue(TElement element)
Called when Classify expects the element to be one of the following types: byte, sbyte, short, ushort, int, uint, long, ulong, BigInteger, decimal, float, double, bool, char, string, DateTime or an enum type. The implementation is free to return a value of any of these types, and Classify will automatically use ExactConvert to convert the value to the required target type. (see also remarks)
string
GetType(TElement element, out bool isFullType)
Determines the type of the object stored in the specified element. (see also remarks)
bool
HasField(TElement element, string fieldName, string declaringType)
Determines whether the element is an object and contains a sub-element for the specified field. (see also remarks)
bool
IsNull(TElement element)
Determines whether the specified element represents a null value. (see also remarks)
bool
IsReferable(TElement element)
Determines whether this element represents an object that can be referred to by a reference element. (see also remarks)
bool
IsReference(TElement element)
Determines whether this element represents a reference to another object in the same serialized graph. (see also remarks)
TElement
ReadFromStream(Stream stream)
Reads the serialized form from a stream.
void Throws an InvalidOperationException informing the user that an element is a reference (IClassifyFormat<TElement>.IsReference(TElement)) but the corresponding referable has not been encountered while deserializing.
void
WriteToStream(TElement element, Stream stream)
Writes the serialized form to a stream.