Antmicro.Migrant.CollectionMetaToken.IsCollection C# (CSharp) Method

IsCollection() public static method

public static IsCollection ( Type actualType ) : bool
actualType System.Type
return bool
        public static bool IsCollection(Type actualType)
        {
            var typeToCheck = actualType.IsGenericType ? actualType.GetGenericTypeDefinition() : actualType;
            return SpeciallySerializedCollections.Contains(typeToCheck);
        }

Same methods

CollectionMetaToken::IsCollection ( Antmicro.Migrant.TypeDescriptor actualType ) : bool

Usage Example

Beispiel #1
0
 internal static CreationWay GetCreationWay(Type actualType, bool treatCollectionAsUserObject)
 {
     if (Helpers.CanBeCreatedWithDataOnly(actualType, treatCollectionAsUserObject))
     {
         return(CreationWay.Null);
     }
     if (!treatCollectionAsUserObject && CollectionMetaToken.IsCollection(actualType))
     {
         return(CreationWay.DefaultCtor);
     }
     if (typeof(ISpeciallySerializable).IsAssignableFrom(actualType))
     {
         return(CreationWay.DefaultCtor);
     }
     return(CreationWay.Uninitialized);
 }