Version 3.3.0.1

GenericCollectionFormatter<TCollection, TElement> class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public sealed class GenericCollectionFormatter<TCollection, TElement> : BaseFormatter<TCollection>, IFormatter<TCollection>, IFormatter where TCollection : ICollection<TElement>, new()
Formatter for all eligible types that implement the interface System.Collections.Generic.ICollection<T>, and which have no other formatters specified.

Eligibility for formatting by this class is determined by the CanFormat(Type, out Type) method.

Inheritance
  • System.Object
  • BaseFormatter<TCollection>
  • GenericCollectionFormatter<TCollection, TElement>

Type Parameters

TCollection

The type of the collection.

TElement

The type of the element.

Constructors

GenericCollectionFormatter()
public GenericCollectionFormatter()

Methods

DeserializeImplementation(ref TCollection, IDataReader)
Provides the actual implementation for deserializing a value of type .
protected override void DeserializeImplementation(ref TCollection value, IDataReader reader)
Parameters
TCollection value

The uninitialized value to serialize into. This value will have been created earlier using GetUninitializedObject().

Sirenix.Serialization.IDataReader reader

The reader to deserialize with.

GetUninitializedObject()
Gets a new object of type .
protected override TCollection GetUninitializedObject()
Returns
TCollection

A new object of type .

SerializeImplementation(ref TCollection, IDataWriter)
Provides the actual implementation for serializing a value of type .
protected override void SerializeImplementation(ref TCollection value, IDataWriter writer)
Parameters
TCollection value

The value to serialize.

Sirenix.Serialization.IDataWriter writer

The writer to serialize with.