C# 클래스 Catel.Reflection.TypeCache

Cache containing the types of an appdomain.
파일 보기 프로젝트 열기: Catel/Catel

공개 메소드들

메소드 설명
GetType ( string typeNameWithAssembly, bool ignoreCase = false ) : Type

Gets the specified type from the loaded assemblies.

GetTypeWithAssembly ( string typeName, string assemblyName, bool ignoreCase = false ) : Type

Gets the specified type from the loaded assemblies.

GetTypeWithoutAssembly ( string typeNameWithoutAssembly, bool ignoreCase = false ) : Type

Gets the type without assembly. For example, when the value Catel.TypeHelper is used as parameter, the type for Catel.TypeHelper, Catel.Core will be returned.

Note that this method can only support one type of "simple type name" resolving. For example, if "Catel.TypeHelper" is located in multiple assemblies, it will always use the latest known type for resolving the type.

GetTypes ( bool>.Func predicate = null ) : System.Type[]

Gets all the types from the current AppDomain where the predicate returns true.

GetTypesImplementingInterface ( Type interfaceType ) : System.Type[]

Gets the types implementing the specified interface.

GetTypesOfAssembly ( Assembly assembly, bool>.Func predicate = null ) : System.Type[]

Gets the types of the specified assembly.

InitializeTypes ( Assembly assembly = null, bool forceFullInitialization = false ) : void

Initializes the types in the specified assembly. It does this by looping through all loaded assemblies and registering the type by type name and assembly name. The types initialized by this method are used by object.GetType.

InitializeTypes ( bool forceFullInitialization, string assemblyName ) : void

Initializes the types. It does this by looping through all loaded assemblies and registering the type by type name and assembly name. The types initialized by this method are used by object.GetType.

비공개 메소드들

메소드 설명
GetAssemblyTypes ( List assemblies ) : HashSet>.Dictionary
GetType ( string typeName, string assemblyName, bool ignoreCase ) : Type

Gets the type.

GetTypeBySplittingInternals ( string typeWithInnerTypes ) : Type

Gets the type by splitting internal types. This means that System.Collections.List`1[[MyCustomType.Item]] will be splitted and resolved separately.

GetTypesPrefilteredByAssembly ( string assemblyName, bool>.Func predicate ) : System.Type[]

Gets the types prefiltered by assembly. If types must be retrieved from a single assembly only, this method is very fast.

InitializeAssemblies ( IEnumerable assemblies, bool force ) : void
InitializeType ( Assembly assembly, Type type ) : void
InitializeTypes ( bool forceFullInitialization, Assembly assembly = null ) : void
OnAssemblyLoaded ( object sender, AssemblyLoadEventArgs args ) : void

Called when an assembly is loaded in the current AppDomain.

ShouldIgnoreAssembly ( Assembly assembly ) : bool

Determines whether the specified assembly must be ignored by the type cache.

ShouldIgnoreType ( Assembly assembly, Type type ) : bool

Determines whether the specified type must be ignored by the type cache.

TypeCache ( ) : System

메소드 상세

GetType() 공개 정적인 메소드

Gets the specified type from the loaded assemblies.
The is null or whitespace.
public static GetType ( string typeNameWithAssembly, bool ignoreCase = false ) : Type
typeNameWithAssembly string The name of the type including namespace and assembly, formatted with the method.
ignoreCase bool A value indicating whether the case should be ignored.
리턴 System.Type

GetTypeWithAssembly() 공개 정적인 메소드

Gets the specified type from the loaded assemblies.
The is null or whitespace. The is null or whitespace.
public static GetTypeWithAssembly ( string typeName, string assemblyName, bool ignoreCase = false ) : Type
typeName string The name of the type including namespace.
assemblyName string The name of the type including namespace.
ignoreCase bool A value indicating whether the case should be ignored.
리턴 System.Type

GetTypeWithoutAssembly() 공개 정적인 메소드

Gets the type without assembly. For example, when the value Catel.TypeHelper is used as parameter, the type for Catel.TypeHelper, Catel.Core will be returned.
Note that this method can only support one type of "simple type name" resolving. For example, if "Catel.TypeHelper" is located in multiple assemblies, it will always use the latest known type for resolving the type.
The is null or whitespace.
public static GetTypeWithoutAssembly ( string typeNameWithoutAssembly, bool ignoreCase = false ) : Type
typeNameWithoutAssembly string The type name without assembly.
ignoreCase bool A value indicating whether the case should be ignored.
리턴 System.Type

GetTypes() 공개 정적인 메소드

Gets all the types from the current AppDomain where the predicate returns true.
The is null.
public static GetTypes ( bool>.Func predicate = null ) : System.Type[]
predicate bool>.Func The predicate where the type should apply to.
리턴 System.Type[]

GetTypesImplementingInterface() 공개 정적인 메소드

Gets the types implementing the specified interface.
public static GetTypesImplementingInterface ( Type interfaceType ) : System.Type[]
interfaceType System.Type Type of the interface.
리턴 System.Type[]

GetTypesOfAssembly() 공개 정적인 메소드

Gets the types of the specified assembly.
public static GetTypesOfAssembly ( Assembly assembly, bool>.Func predicate = null ) : System.Type[]
assembly System.Reflection.Assembly The assembly.
predicate bool>.Func The predicate to use on the types.
리턴 System.Type[]

InitializeTypes() 공개 정적인 메소드

Initializes the types in the specified assembly. It does this by looping through all loaded assemblies and registering the type by type name and assembly name. The types initialized by this method are used by object.GetType.
public static InitializeTypes ( Assembly assembly = null, bool forceFullInitialization = false ) : void
assembly System.Reflection.Assembly The assembly to initialize the types from. If null, all assemblies will be checked.
forceFullInitialization bool If true, the types are initialized, even when the types are already initialized.
리턴 void

InitializeTypes() 공개 정적인 메소드

Initializes the types. It does this by looping through all loaded assemblies and registering the type by type name and assembly name. The types initialized by this method are used by object.GetType.
The is null or whitespace.
public static InitializeTypes ( bool forceFullInitialization, string assemblyName ) : void
forceFullInitialization bool If true, the types are initialized, even when the types are already initialized.
assemblyName string Name of the assembly. If null, all assemblies will be checked.
리턴 void