C# Class FullInspector.Internal.fiReflectionUtility

Afficher le fichier Open project: jacobdufault/fullinspector

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

GetCreatableTypesDeriving() public static méthode

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.
Résultat List

GetExactImplementation() public static méthode

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. ///
Résultat System.Type

GetObjectTypeNameSafe() public static méthode

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
Résultat string

GetTypesDeriving() public static méthode

public static GetTypesDeriving ( Type baseType ) : List
baseType System.Type
Résultat List