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)
  • Abstract
Generates an element that represents a dictionary. (see also remarks)
TElement
FormatKeyValuePair(TElement key, TElement value)
  • Abstract
Generates an element that represents a key-value pair. (see also remarks)
TElement
FormatList(bool isTuple, IEnumerable<TElement> values)
  • Abstract
Generates an element that represents a list. (see also remarks)
TElement
  • Abstract
Generates an element that represents a null value. (see also remarks)
TElement
FormatObject(IEnumerable<ObjectFieldInfo<TElement>> fields)
  • Abstract
Generates an element that represents an object with fields. (see also remarks)
TElement
FormatRawData(byte[] value)
  • Abstract
Generates an element that represents raw data (byte[]). (see also remarks)
TElement
FormatReferable(TElement element, int refId)
  • Abstract
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)
  • Abstract
Generates an element that represents a reference to another object within the same serialized object graph. (see also remarks)
TElement
FormatSelfValue(TElement value)
  • Abstract
Generates an element that represents a value of the same type as serialized elements. (see also remarks)
TElement
FormatSimpleValue(object value)
  • Abstract
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)
  • Abstract
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)
  • Abstract
Decodes a dictionary. (see also remarks)
TElement
GetField(TElement element, string fieldName, string declaringType)
  • Abstract
Returns the sub-element pertaining to the specified field. (see also remarks)
void
GetKeyValuePair(TElement element, out TElement key, out TElement value)
  • Abstract
Decodes a key-value pair. (see also remarks)
IEnumerable<TElement>
GetList(TElement element, int? tupleSize)
  • Abstract
Decodes a list. (see also remarks)
byte[]
GetRawData(TElement element)
  • Abstract
Decodes a piece of raw data. (see also remarks)
int
GetReferenceID(TElement element)
  • Abstract
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)
  • Abstract
Decodes the serialized form of the element type itself. (see also remarks)
object
GetSimpleValue(TElement element)
  • Abstract
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)
  • Abstract
Determines the type of the object stored in the specified element. (see also remarks)
bool
HasField(TElement element, string fieldName, string declaringType)
  • Abstract
Determines whether the element is an object and contains a sub-element for the specified field. (see also remarks)
bool
IsNull(TElement element)
  • Abstract
Determines whether the specified element represents a null value. (see also remarks)
bool
IsReferable(TElement element)
  • Abstract
Determines whether this element represents an object that can be referred to by a reference element. (see also remarks)
bool
IsReference(TElement element)
  • Abstract
Determines whether this element represents a reference to another object in the same serialized graph. (see also remarks)
TElement
ReadFromStream(Stream stream)
  • Abstract
Reads the serialized form from a stream.
void
  • Abstract
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)
  • Abstract
Writes the serialized form to a stream.