C# Class Patchwork.Engine.Utility.CecilLoader

Helper and extension methods for loading code elements from their Cecil metadata.
Datei anzeigen Open project: GregRos/Patchwork

Public Methods

Method Description
LoadField ( this fieldDef ) : FieldInfo

Loads a Cecil.FieldDefinition as a System.FieldInfo. Requires loading the assembly.

LoadIntoMemory ( this def, bool reflectionOnly = false ) : Assembly

Loads a copy of the assembly from memory.

LoadLocalAssembly ( this assemblyDef ) : Assembly

Tries to load the assembly from disk by using its Cecil identifiers. Can fail, so don't use it often.

LoadMethod ( this methodDef ) : MethodBase

Converts a Cecil.MethodDefinition to a MethodBase. Also converts constructors. Requires loading the type and/or assembly.

LoadType ( this typeDef ) : Type

Loads a type using its Cecil definition. Involves loading the assembly from disk.

Private Methods

Method Description
LoadMember ( this memberDef ) : MemberInfo

Loads the member from its IMemberDefinition.

LoadProperty ( this propDef ) : PropertyInfo

Loads the property from its Cecil metadata. Involves loading the assembly from disk.

Method Details

LoadField() public static method

Loads a Cecil.FieldDefinition as a System.FieldInfo. Requires loading the assembly.
Could not find the field.
public static LoadField ( this fieldDef ) : FieldInfo
fieldDef this The field definition.
return System.Reflection.FieldInfo

LoadIntoMemory() public static method

Loads a copy of the assembly from memory.
public static LoadIntoMemory ( this def, bool reflectionOnly = false ) : Assembly
def this The definition.
reflectionOnly bool
return System.Reflection.Assembly

LoadLocalAssembly() public static method

Tries to load the assembly from disk by using its Cecil identifiers. Can fail, so don't use it often.
Could not load the assembly from its Mono.Cecil definition.
public static LoadLocalAssembly ( this assemblyDef ) : Assembly
assemblyDef this The assembly definition.
return System.Reflection.Assembly

LoadMethod() public static method

Converts a Cecil.MethodDefinition to a MethodBase. Also converts constructors. Requires loading the type and/or assembly.
No member matched the search criteria. Could not load the type or assembly. More than one member matched the search criteria.
public static LoadMethod ( this methodDef ) : MethodBase
methodDef this The method definition.
return System.Reflection.MethodBase

LoadType() public static method

Loads a type using its Cecil definition. Involves loading the assembly from disk.
Could not find the type from its Mono.Cecil identifiers, or could not load the /// assembly.
public static LoadType ( this typeDef ) : Type
typeDef this The type definition.
return System.Type