Class CollectionConverter<T, TCollection>
A base class for all
Implements
Inherited Members
Namespace: IPA.Config.Stores.Converters
Assembly: IPA.Loader.dll
Syntax
public class CollectionConverter<T, TCollection> : ValueConverter<TCollection>, IValueConverter where TCollection : ICollection<T>
Type Parameters
Name | Description |
---|---|
T | the type of the items in the collection |
TCollection | the instantiated type of collection |
Constructors
| Improve this Doc View SourceCollectionConverter()
Creates a CollectionConverter<T, TCollection> using the default converter for the element type. Equivalent to calling CollectionConverter(ValueConverter<T>) with Default.
Declaration
public CollectionConverter()
See Also
| Improve this Doc View SourceCollectionConverter(ValueConverter<T>)
Creates a CollectionConverter<T, TCollection> using the specified underlying converter.
Declaration
public CollectionConverter(ValueConverter<T> underlying)
Parameters
Type | Name | Description |
---|---|---|
ValueConverter<T> | underlying | the ValueConverter<T> to use to convert the values |
Properties
| Improve this Doc View SourceBaseConverter
Gets the converter for the collection's value type.
Declaration
protected ValueConverter<T> BaseConverter { get; }
Property Value
Type | Description |
---|---|
ValueConverter<T> |
Methods
| Improve this Doc View SourceCreate(Int32, Object)
Creates a collection of type TCollection
using the size
and
parent
.
Declaration
protected virtual TCollection Create(int size, object parent)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | the initial size of the collecion |
Object | parent | the object that will own the new collection |
Returns
Type | Description |
---|---|
TCollection | a new instance of |
See Also
| Improve this Doc View SourceFromValue(Value, Object)
Deserializes a List in value
into a new TCollection
owned by parent
.
Declaration
public override TCollection FromValue(Value value, object parent)
Parameters
Type | Name | Description |
---|---|---|
Value | value | the List to convert to a |
Object | parent | the object that will own the resulting |
Returns
Type | Description |
---|---|
TCollection | a new |
Overrides
See Also
| Improve this Doc View SourcePopulateFromValue(TCollection, List, Object)
Populates the colleciton col
with the deserialized values from list
with the parent parent
.
Declaration
protected void PopulateFromValue(TCollection col, List list, object parent)
Parameters
Type | Name | Description |
---|---|---|
TCollection | col | the collection to populate |
List | list | the values to populate it with |
Object | parent | the object that will own the new objects |
See Also
| Improve this Doc View SourceToValue(TCollection, Object)
Serializes a TCollection
into a List.
Declaration
public override Value ToValue(TCollection obj, object parent)
Parameters
Type | Name | Description |
---|---|---|
TCollection | obj | the |
Object | parent | the object owning |
Returns
Type | Description |
---|---|
Value | the List that |