Click or drag to resize
DefaultConcreteTypeRepositoryRegister Method
Registers the default type of the collection.

Namespace: MsgPack.Serialization
Assembly: MsgPack (in MsgPack.dll) Version: 0.6.0
Syntax
public void Register(
	Type abstractCollectionType,
	Type defaultCollectionType
)

Parameters

abstractCollectionType
Type: SystemType
Type of the abstract collection.
defaultCollectionType
Type: SystemType
Default concrete type of the abstractCollectionType.
Exceptions
ExceptionCondition
ArgumentNullExceptionabstractCollectionType is null. Or defaultCollectionType is null.
ArgumentExceptionabstractCollectionType is not collection type. Or defaultCollectionType is abstract class or interface. Or defaultCollectionType is open generic type but abstractCollectionType is closed generic type. Or defaultCollectionType is closed generic type but abstractCollectionType is open generic type. Or defaultCollectionType does not have same arity for abstractCollectionType. Or defaultCollectionType is not assignable to abstractCollectionType or the constructed type from defaultCollectionType will not be assignable to the constructed type from abstractCollectionType.
Remarks
If you want to overwrite default type for collection interfaces, you can use this method. Note that this method only supports collection interface, that is subtype of the IEnumerable interface.
Note Note
If you register invalid type for defaultCollectionType, then runtime exception will be occurred. For example, you register IEnumerableT of Char and String pair, but it will cause runtime error.
See Also