C# Class Rock.Reflection

Static helper methods for using Reflection
Mostra file Open project: NewSpring/Rock

Public Methods

Method Description
FindType ( Type baseType, string typeName ) : Type

Finds the first matching type in Rock or any of the assemblies that reference Rock

FindTypes ( Type baseType, string typeName = null ) : Type>.SortedDictionary

Finds the all the types that implement or inherit from the baseType. The baseType will not be included in the result

GetCategory ( Type type ) : string

Returns the Category Attribute value for a given type

GetDbContextForEntityType ( Type entityType ) : System.Data.Entity.DbContext

Gets the appropriate DbContext based on the entity type

GetDescription ( Type type ) : string

Returns the Description Attribute value for a given type

GetDisplayName ( Type type ) : string

Returns the DisplayName Attribute value for a given type

GetServiceForEntityType ( Type entityType, System dbContext ) : Rock.Data.IService

Gets the appropriate Rock.Data.IService based on the entity type

SearchAssembly ( Assembly assembly, Type baseType ) : Type>.Dictionary

Searches the assembly.

Method Details

FindType() public static method

Finds the first matching type in Rock or any of the assemblies that reference Rock
public static FindType ( Type baseType, string typeName ) : Type
baseType System.Type Type of the base.
typeName string Name of the type.
return System.Type

FindTypes() public static method

Finds the all the types that implement or inherit from the baseType. The baseType will not be included in the result
public static FindTypes ( Type baseType, string typeName = null ) : Type>.SortedDictionary
baseType System.Type base type.
typeName string typeName can be specified to filter it to a specific type name
return Type>.SortedDictionary

GetCategory() public static method

Returns the Category Attribute value for a given type
public static GetCategory ( Type type ) : string
type System.Type
return string

GetDbContextForEntityType() public static method

Gets the appropriate DbContext based on the entity type
public static GetDbContextForEntityType ( Type entityType ) : System.Data.Entity.DbContext
entityType System.Type Type of the Entity.
return System.Data.Entity.DbContext

GetDescription() public static method

Returns the Description Attribute value for a given type
public static GetDescription ( Type type ) : string
type System.Type
return string

GetDisplayName() public static method

Returns the DisplayName Attribute value for a given type
public static GetDisplayName ( Type type ) : string
type System.Type
return string

GetServiceForEntityType() public static method

Gets the appropriate Rock.Data.IService based on the entity type
public static GetServiceForEntityType ( Type entityType, System dbContext ) : Rock.Data.IService
entityType System.Type Type of the Entity.
dbContext System The database context.
return Rock.Data.IService

SearchAssembly() public static method

Searches the assembly.
public static SearchAssembly ( Assembly assembly, Type baseType ) : Type>.Dictionary
assembly System.Reflection.Assembly The assembly.
baseType System.Type Type of the base.
return Type>.Dictionary