Version 3.3.0.1

GenericCollectionFormatter class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public static class GenericCollectionFormatter
Inheritance
  • System.Object
  • GenericCollectionFormatter

Methods

CanFormat(Type, out Type)
Determines whether the specified type can be formatted by a GenericCollectionFormatter<TCollection, TElement>.

The following criteria are checked: type implements System.Collections.Generic.ICollection<T>, type is not abstract, type is not a generic type definition, type is not an interface, type has a public parameterless constructor.

public static bool CanFormat(Type type, out Type elementType)
Parameters
System.Type type

The collection type to check.

System.Type elementType

The element type of the collection.

Returns
System.Boolean

true if the type can be formatted by a GenericCollectionFormatter<TCollection, TElement>, otherwise false

Exceptions
System.ArgumentNullException

The type argument is null.