C# 클래스 Hiro.TypeDefinitionExtensions

A class that extends the TypeDefinition class with features similar to the features in the System.Reflection.Emit namespace.
파일 보기 프로젝트 열기: philiplaureano/Hiro

공개 메소드들

메소드 설명
AddDefaultConstructor ( this targetType ) : Mono.Cecil.MethodDefinition

Adds a default constructor to the target type.

AddDefaultConstructor ( this targetType, System parentType ) : Mono.Cecil.MethodDefinition

Adds a default constructor to the target type.

AddProperty ( this typeDef, string propertyName, System propertyType ) : void

Adds a rewritable property to the target type.

AddProperty ( this typeDef, string propertyName, TypeReference propertyType ) : void

Adds a rewritable property to the target type.

AddProperty ( this typeDef, string propertyName, TypeReference propertyType, Mono.Cecil.MethodDefinition getter, Mono.Cecil.MethodDefinition setter ) : void

Adds a rewriteable property to the target type using an existing getter and setter.

DefineMethod ( this typeDef, string methodName, Mono attributes, System returnType, System parameterTypes, System genericParameterTypes ) : Mono.Cecil.MethodDefinition

Adds a new method to the target type.

GetDefaultConstructor ( this targetType ) : Mono.Cecil.MethodDefinition

Returns the first constructor defined on the target type.

Implements ( this type, TypeReference interfaceType ) : bool

Tests if a TypeDefinition implements directly a certain TypeReference.

비공개 메소드들

메소드 설명
AddPropertyGetter ( TypeReference propertyType, string getterName, Mono attributes, FieldReference backingField ) : Mono.Cecil.MethodDefinition

Creates a property getter method implementation with the propertyType as the return type.

AddPropertySetter ( TypeReference propertyType, Mono attributes, FieldReference backingField, string setterName, TypeReference voidType ) : Mono.Cecil.MethodDefinition

Creates a property setter method implementation with the propertyType as the setter parameter.

GetBackingField ( string fieldName, Mono.Cecil.TypeDefinition typeDef, TypeReference propertyType ) : FieldReference

Resolves the backing field for a generic type declaration.

메소드 상세

AddDefaultConstructor() 공개 정적인 메소드

Adds a default constructor to the target type.
public static AddDefaultConstructor ( this targetType ) : Mono.Cecil.MethodDefinition
targetType this The type that will contain the default constructor.
리턴 Mono.Cecil.MethodDefinition

AddDefaultConstructor() 공개 정적인 메소드

Adds a default constructor to the target type.
public static AddDefaultConstructor ( this targetType, System parentType ) : Mono.Cecil.MethodDefinition
targetType this The type that will contain the default constructor.
parentType System The base class that contains the default constructor that will be used for constructor chaining..
리턴 Mono.Cecil.MethodDefinition

AddProperty() 공개 정적인 메소드

Adds a rewritable property to the target type.
public static AddProperty ( this typeDef, string propertyName, System propertyType ) : void
typeDef this The target type that will hold the newly-created property.
propertyName string The name of the property itself.
propertyType System The instance that describes the property type.
리턴 void

AddProperty() 공개 정적인 메소드

Adds a rewritable property to the target type.
public static AddProperty ( this typeDef, string propertyName, TypeReference propertyType ) : void
typeDef this The target type that will hold the newly-created property.
propertyName string The name of the property itself.
propertyType Mono.Cecil.TypeReference The instance that describes the property type.
리턴 void

AddProperty() 공개 정적인 메소드

Adds a rewriteable property to the target type using an existing getter and setter.
public static AddProperty ( this typeDef, string propertyName, TypeReference propertyType, Mono.Cecil.MethodDefinition getter, Mono.Cecil.MethodDefinition setter ) : void
typeDef this The target type that will hold the newly-created property.
propertyName string The name of the property itself.
propertyType Mono.Cecil.TypeReference The instance that describes the property type.
getter Mono.Cecil.MethodDefinition The property getter method.
setter Mono.Cecil.MethodDefinition The property setter method.
리턴 void

DefineMethod() 공개 정적인 메소드

Adds a new method to the target type.
public static DefineMethod ( this typeDef, string methodName, Mono attributes, System returnType, System parameterTypes, System genericParameterTypes ) : Mono.Cecil.MethodDefinition
typeDef this The type that will hold the newly-created method.
methodName string The name to be given to the new method.
attributes Mono The parameter that describes the characteristics of the method.
returnType System The method return type.
parameterTypes System The list of argument types that will be used to define the method signature.
genericParameterTypes System The list of generic argument types that will be used to define the method signature.
리턴 Mono.Cecil.MethodDefinition

GetDefaultConstructor() 공개 정적인 메소드

Returns the first constructor defined on the target type.
public static GetDefaultConstructor ( this targetType ) : Mono.Cecil.MethodDefinition
targetType this The type to search for a default constructor
리턴 Mono.Cecil.MethodDefinition

Implements() 공개 정적인 메소드

Tests if a TypeDefinition implements directly a certain TypeReference.
public static Implements ( this type, TypeReference interfaceType ) : bool
type this The to test.
interfaceType Mono.Cecil.TypeReference The which reprents the interface.
리턴 bool