C# Class Hypermedia.TypeHelper

Show file Open project: cosullivan/Hypermedia

Public Methods

Method Description
GetCollectionType ( Type type ) : Type

Gets the underlying ICollection type.

GetCollectionType ( TypeInfo type ) : Type

Gets the underlying ICollection type.

GetEnumerableType ( Type type ) : Type

Gets the underlying IEnumerable type.

GetUnderlyingType ( Type type ) : Type

Gets the underlying element type.

GetUnderlyingType ( TypeInfo type ) : Type

Gets the underlying element type.

IsCollection ( Type type ) : bool

Returns a value indicating whether or not the type is an ICollection.

IsEnumerable ( Type type ) : bool

Returns a value indicating whether or not the given type is an IEnumerable type.

IsList ( Type type ) : bool

Returns a value indicating whether or no the given type is an IList.

IsList ( TypeInfo type ) : bool

Returns a value indicating whether or no the given type is an IList.

IsReferenceType ( Type type ) : bool

Returns a value indicating whether or not he given type is to be considered a reference type.

TryGetCollectionType ( Type type, Type &collectionType ) : bool

Attempt to get the ICollection type from the given base type.

TryGetCollectionType ( TypeInfo type, Type &collectionType ) : bool

Attempt to get the ICollection type from the given base type.

TryGetEnumerableType ( Type type, Type &enumerableType ) : bool

Attempt to get the IEnumerable type from the given base type.

Private Methods

Method Description
GetEnumerableType ( TypeInfo type ) : Type

Gets the underlying IEnumerable type.

TryGetEnumerableType ( TypeInfo type, Type &enumerableType ) : bool

Attempt to get the IEnumerable type from the given base type.

Method Details

GetCollectionType() public static method

Gets the underlying ICollection type.
public static GetCollectionType ( Type type ) : Type
type System.Type The type to extract the underlying collection type (if any).
return System.Type

GetCollectionType() public static method

Gets the underlying ICollection type.
public static GetCollectionType ( TypeInfo type ) : Type
type System.Reflection.TypeInfo The type to extract the underlying collection type (if any).
return System.Type

GetEnumerableType() public static method

Gets the underlying IEnumerable type.
public static GetEnumerableType ( Type type ) : Type
type System.Type The type to extract the underlying enumerable type (if any).
return System.Type

GetUnderlyingType() public static method

Gets the underlying element type.
public static GetUnderlyingType ( Type type ) : Type
type System.Type The type to extract the underlying type (if any).
return System.Type

GetUnderlyingType() public static method

Gets the underlying element type.
public static GetUnderlyingType ( TypeInfo type ) : Type
type System.Reflection.TypeInfo The type to extract the underlying type (if any).
return System.Type

IsCollection() public static method

Returns a value indicating whether or not the type is an ICollection.
public static IsCollection ( Type type ) : bool
type System.Type The type to test against.
return bool

IsEnumerable() public static method

Returns a value indicating whether or not the given type is an IEnumerable type.
public static IsEnumerable ( Type type ) : bool
type System.Type The type to test against.
return bool

IsList() public static method

Returns a value indicating whether or no the given type is an IList.
public static IsList ( Type type ) : bool
type System.Type The type to check for the prescence of IList.
return bool

IsList() public static method

Returns a value indicating whether or no the given type is an IList.
public static IsList ( TypeInfo type ) : bool
type System.Reflection.TypeInfo The type to check for the prescence of IList.
return bool

IsReferenceType() public static method

Returns a value indicating whether or not he given type is to be considered a reference type.
public static IsReferenceType ( Type type ) : bool
type System.Type The type to check whether it is a reference type.
return bool

TryGetCollectionType() public static method

Attempt to get the ICollection type from the given base type.
public static TryGetCollectionType ( Type type, Type &collectionType ) : bool
type System.Type The base type info to get the collection type from.
collectionType System.Type The collection type for the given base type.
return bool

TryGetCollectionType() public static method

Attempt to get the ICollection type from the given base type.
public static TryGetCollectionType ( TypeInfo type, Type &collectionType ) : bool
type System.Reflection.TypeInfo The base type info to get the collection type from.
collectionType System.Type The collection type for the given base type.
return bool

TryGetEnumerableType() public static method

Attempt to get the IEnumerable type from the given base type.
public static TryGetEnumerableType ( Type type, Type &enumerableType ) : bool
type System.Type The base type info to get the enumerable type from.
enumerableType System.Type The enumerable type for the given base type.
return bool