C# Класс Hypermedia.TypeHelper

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

GetCollectionType() публичный статический Метод

Gets the underlying ICollection type.
public static GetCollectionType ( Type type ) : Type
type System.Type The type to extract the underlying collection type (if any).
Результат System.Type

GetCollectionType() публичный статический Метод

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).
Результат System.Type

GetEnumerableType() публичный статический Метод

Gets the underlying IEnumerable type.
public static GetEnumerableType ( Type type ) : Type
type System.Type The type to extract the underlying enumerable type (if any).
Результат System.Type

GetUnderlyingType() публичный статический Метод

Gets the underlying element type.
public static GetUnderlyingType ( Type type ) : Type
type System.Type The type to extract the underlying type (if any).
Результат System.Type

GetUnderlyingType() публичный статический Метод

Gets the underlying element type.
public static GetUnderlyingType ( TypeInfo type ) : Type
type System.Reflection.TypeInfo The type to extract the underlying type (if any).
Результат System.Type

IsCollection() публичный статический Метод

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.
Результат bool

IsEnumerable() публичный статический Метод

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.
Результат bool

IsList() публичный статический Метод

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.
Результат bool

IsList() публичный статический Метод

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.
Результат bool

IsReferenceType() публичный статический Метод

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.
Результат bool

TryGetCollectionType() публичный статический Метод

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.
Результат bool

TryGetCollectionType() публичный статический Метод

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.
Результат bool

TryGetEnumerableType() публичный статический Метод

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.
Результат bool