C# Class OTAPI.Patcher.Engine.Extensions.CecilHelpers

显示文件 Open project: DeathCradle/Open-Terraria-API

Public Methods

Method Description
CompareParameterTypes ( this source, IEnumerable parameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : bool
Constructor ( this type ) : Mono.Cecil.MethodDefinition

Returns the default constructor, expecting only one in the type.

Field ( this typeDefinition, string name ) : FieldDefinition
ForEachInstruction ( this module, Mono.Cecil.Cil.Instruction>.Action callback ) : void

Enumerates all instructions in all methods across each type of the assembly

ForEachMethod ( this module, Action callback ) : void

Enumerates all methods in the current module

ForEachNestedType ( this parent, Action callback ) : void
ForEachType ( this module, Action callback ) : void

Enumerates over each type in the assembly, including nested types

Method ( this typeDefinition, string name, Collection parameters, bool isStatic = null, int skipMethodParameters, int skipInputParameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : Mono.Cecil.MethodDefinition
Method ( this typeDefinition, string name, System parameters, bool isStatic = null, int skipMethodParameters, int skipInputParameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : Mono.Cecil.MethodDefinition
Method ( this typeDefinition, string name, bool isStatic = null, ParameterTypeCollection parameters = null, int skipMethodParameters, int skipInputParameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : Mono.Cecil.MethodDefinition
NestedType ( this typeDefinition, string name ) : Mono.Cecil.TypeDefinition
Next ( this initial, Boolean>.Func predicate ) : Instruction
Next ( this initial, int count = -1 ) : List
Previous ( this initial, Boolean>.Func predicate ) : Instruction
Previous ( this initial, int count ) : Instruction
Property ( this typeDefinition, string name ) : Mono.Cecil.PropertyDefinition
SignatureMatches ( this method, Mono.Cecil.MethodDefinition compareTo, bool ignoreDeclaringType = true ) : bool
SignatureMatches ( this type, Mono.Cecil.TypeDefinition compareTo ) : bool
StaticConstructor ( this type ) : Mono.Cecil.MethodDefinition

Returns the static constructor of the type, if any

Type ( this moduleDefinition, string fullName ) : Mono.Cecil.TypeDefinition

Returns a type from the current module by its fullName

TypeDefinition ( this type, AssemblyDefinition definition ) : Mono.Cecil.TypeDefinition

Method Details

CompareParameterTypes() public static method

public static CompareParameterTypes ( this source, IEnumerable parameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : bool
source this
parameters IEnumerable
acceptParamObjectTypes bool
substituteByRefs bool
return bool

Constructor() public static method

Returns the default constructor, expecting only one in the type.
public static Constructor ( this type ) : Mono.Cecil.MethodDefinition
type this
return Mono.Cecil.MethodDefinition

Field() public static method

public static Field ( this typeDefinition, string name ) : FieldDefinition
typeDefinition this
name string
return Mono.Cecil.FieldDefinition

ForEachInstruction() public static method

Enumerates all instructions in all methods across each type of the assembly
public static ForEachInstruction ( this module, Mono.Cecil.Cil.Instruction>.Action callback ) : void
module this
callback Mono.Cecil.Cil.Instruction>.Action
return void

ForEachMethod() public static method

Enumerates all methods in the current module
public static ForEachMethod ( this module, Action callback ) : void
module this
callback Action
return void

ForEachNestedType() public static method

public static ForEachNestedType ( this parent, Action callback ) : void
parent this
callback Action
return void

ForEachType() public static method

Enumerates over each type in the assembly, including nested types
public static ForEachType ( this module, Action callback ) : void
module this
callback Action
return void

Method() public static method

public static Method ( this typeDefinition, string name, Collection parameters, bool isStatic = null, int skipMethodParameters, int skipInputParameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : Mono.Cecil.MethodDefinition
typeDefinition this
name string
parameters Collection
isStatic bool
skipMethodParameters int
skipInputParameters int
acceptParamObjectTypes bool
substituteByRefs bool
return Mono.Cecil.MethodDefinition

Method() public static method

public static Method ( this typeDefinition, string name, System parameters, bool isStatic = null, int skipMethodParameters, int skipInputParameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : Mono.Cecil.MethodDefinition
typeDefinition this
name string
parameters System
isStatic bool
skipMethodParameters int
skipInputParameters int
acceptParamObjectTypes bool
substituteByRefs bool
return Mono.Cecil.MethodDefinition

Method() public static method

public static Method ( this typeDefinition, string name, bool isStatic = null, ParameterTypeCollection parameters = null, int skipMethodParameters, int skipInputParameters, bool acceptParamObjectTypes = false, bool substituteByRefs = false ) : Mono.Cecil.MethodDefinition
typeDefinition this
name string
isStatic bool
parameters ParameterTypeCollection
skipMethodParameters int
skipInputParameters int
acceptParamObjectTypes bool
substituteByRefs bool
return Mono.Cecil.MethodDefinition

NestedType() public static method

public static NestedType ( this typeDefinition, string name ) : Mono.Cecil.TypeDefinition
typeDefinition this
name string
return Mono.Cecil.TypeDefinition

Next() public static method

public static Next ( this initial, Boolean>.Func predicate ) : Instruction
initial this
predicate Boolean>.Func
return Instruction

Next() public static method

public static Next ( this initial, int count = -1 ) : List
initial this
count int
return List

Previous() public static method

public static Previous ( this initial, Boolean>.Func predicate ) : Instruction
initial this
predicate Boolean>.Func
return Instruction

Previous() public static method

public static Previous ( this initial, int count ) : Instruction
initial this
count int
return Instruction

Property() public static method

public static Property ( this typeDefinition, string name ) : Mono.Cecil.PropertyDefinition
typeDefinition this
name string
return Mono.Cecil.PropertyDefinition

SignatureMatches() public static method

public static SignatureMatches ( this method, Mono.Cecil.MethodDefinition compareTo, bool ignoreDeclaringType = true ) : bool
method this
compareTo Mono.Cecil.MethodDefinition
ignoreDeclaringType bool
return bool

SignatureMatches() public static method

public static SignatureMatches ( this type, Mono.Cecil.TypeDefinition compareTo ) : bool
type this
compareTo Mono.Cecil.TypeDefinition
return bool

StaticConstructor() public static method

Returns the static constructor of the type, if any
public static StaticConstructor ( this type ) : Mono.Cecil.MethodDefinition
type this
return Mono.Cecil.MethodDefinition

Type() public static method

Returns a type from the current module by its fullName
public static Type ( this moduleDefinition, string fullName ) : Mono.Cecil.TypeDefinition
moduleDefinition this
fullName string
return Mono.Cecil.TypeDefinition

TypeDefinition() public static method

public static TypeDefinition ( this type, AssemblyDefinition definition ) : Mono.Cecil.TypeDefinition
type this
definition Mono.Cecil.AssemblyDefinition
return Mono.Cecil.TypeDefinition