Version 2.1.0.0

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.

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.