C# Класс FullInspector.Internal.fiReflectionUtility

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

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

Метод Описание
GetCreatableTypesDeriving ( Type baseType ) : List

Returns all types that derive from the base type. This includes generic type definitions, which when returned will have appropriate constructor values injected.

GetExactImplementation ( this type, Type parentType ) : Type

Searches for a particular implementation of the given parent type inside of the type. This is particularly useful if the interface type is an open type, ie, typeof(IFace{}), because this method will then return IFace{} but with appropriate type parameters inserted.

GetObjectTypeNameSafe ( object obj ) : string

Tries to fetch the given CSharpName of the given object type, or null if the object is null.

GetTypesDeriving ( Type baseType ) : List

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

Метод Описание
GetIndexOfName ( Type types, string name ) : int

Helper method to return the index of the Type in the array that has the given Name (or - 1 if the item is not in the array).

SelectBestTypeParameters ( List candidateTypes, Type openGenericType ) : System.Type[]

Orders the given types parameter array so that the order most closely matches the given genericArguments array

TryConstructAssignableGenericType ( Type openGenericType, Type baseType, Type baseTypeGenericDefinition, Type baseTypeGenericArguments, Type &constructedType ) : bool

Attempts to create an instance of openGenericType such that it is can be assigned to baseType.

fiReflectionUtility ( ) : System

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

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

Returns all types that derive from the base type. This includes generic type definitions, which when returned will have appropriate constructor values injected.
public static GetCreatableTypesDeriving ( Type baseType ) : List
baseType System.Type The base parent type.
Результат List

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

Searches for a particular implementation of the given parent type inside of the type. This is particularly useful if the interface type is an open type, ie, typeof(IFace{}), because this method will then return IFace{} but with appropriate type parameters inserted.
public static GetExactImplementation ( this type, Type parentType ) : Type
type this The base type to search for interface
parentType System.Type /// The parent type to search for. Can be an open generic type. ///
Результат System.Type

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

Tries to fetch the given CSharpName of the given object type, or null if the object is null.
public static GetObjectTypeNameSafe ( object obj ) : string
obj object
Результат string

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

public static GetTypesDeriving ( Type baseType ) : List
baseType System.Type
Результат List