C# Class CK.Reflection.EmitHelper

Collection of helpers to emit dynamic code.
Mostra file Open project: Invenietis/ck-core

Public Methods

Method Description
ImplementEmptyStubMethod ( TypeBuilder tB, MethodInfo method, bool isVirtual = false ) : MethodBuilder

Implements a method as a no operation method. Method can be virtual, abstract or not.

ImplementStubProperty ( TypeBuilder tB, PropertyInfo property, bool isVirtual = false ) : PropertyBuilder

Implement a property with getter/setter that relies on a private backup field. This is useful only to provide a temporary implementation of abstract properties that would be generated in a second time (this does not provide more than auto implemented properties available in C# 3.0 and later.

Private Methods

Method Description
EmitEmptyImplementation ( MethodBuilder vM, Type returnType, ParameterInfo parameters ) : void

Method Details

ImplementEmptyStubMethod() public static method

Implements a method as a no operation method. Method can be virtual, abstract or not.
public static ImplementEmptyStubMethod ( TypeBuilder tB, MethodInfo method, bool isVirtual = false ) : MethodBuilder
tB System.Reflection.Emit.TypeBuilder The for the new type.
method System.Reflection.MethodInfo The method to implement.
isVirtual bool Defaults to false: the method is sealed. True to keep the method virtual.
return System.Reflection.Emit.MethodBuilder

ImplementStubProperty() public static method

Implement a property with getter/setter that relies on a private backup field. This is useful only to provide a temporary implementation of abstract properties that would be generated in a second time (this does not provide more than auto implemented properties available in C# 3.0 and later.
public static ImplementStubProperty ( TypeBuilder tB, PropertyInfo property, bool isVirtual = false ) : PropertyBuilder
tB System.Reflection.Emit.TypeBuilder The for the new type.
property System.Reflection.PropertyInfo The property to implement.
isVirtual bool Defaults to false: the method is sealed. True to keep the method virtual.
return System.Reflection.Emit.PropertyBuilder