C# Class Yea.Reflection.Emit.TypeBuilder

Helper class for defining types
Inheritance: IType
Afficher le fichier Open project: OxPatient/Rule-Engine Class Usage Examples

Méthodes publiques

Méthode Description
Create ( ) : Type

Creates the type

CreateConstructor ( MethodAttributes attributes = MethodAttributes.Public, IEnumerable parameterTypes = null, CallingConventions callingConventions = CallingConventions.Standard ) : IMethodBuilder

Creates a constructor

CreateDefaultConstructor ( MethodAttributes attributes = MethodAttributes.Public ) : IMethodBuilder

Creates a default constructor

CreateDefaultProperty ( string name, Type propertyType, PropertyAttributes attributes = PropertyAttributes.SpecialName, MethodAttributes getMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, MethodAttributes setMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, IEnumerable parameters = null ) : IPropertyBuilder

Creates a default property (ex int Property{get;set;}

CreateField ( string name, Type fieldType, FieldAttributes attributes = FieldAttributes.Public ) : FieldBuilder

Creates a field

CreateMethod ( string name, MethodAttributes attributes = MethodAttributes.Public|MethodAttributes.Virtual, Type returnType = null, IEnumerable parameterTypes = null ) : IMethodBuilder

Creates a method

CreateProperty ( string name, Type propertyType, PropertyAttributes attributes = PropertyAttributes.SpecialName, MethodAttributes getMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, MethodAttributes setMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, IEnumerable parameters = null ) : IPropertyBuilder

Creates a property

ToString ( ) : string

Writes out the type builder to a readable string

TypeBuilder ( Assembly assembly, string name, IEnumerable interfaces, Type baseClass, TypeAttributes attributes ) : System

Constructor

Method Details

Create() public méthode

Creates the type
public Create ( ) : Type
Résultat System.Type

CreateConstructor() public méthode

Creates a constructor
public CreateConstructor ( MethodAttributes attributes = MethodAttributes.Public, IEnumerable parameterTypes = null, CallingConventions callingConventions = CallingConventions.Standard ) : IMethodBuilder
attributes MethodAttributes attributes for the constructor (public, private, etc.)
parameterTypes IEnumerable The types for the parameters
callingConventions CallingConventions The calling convention used
Résultat IMethodBuilder

CreateDefaultConstructor() public méthode

Creates a default constructor
public CreateDefaultConstructor ( MethodAttributes attributes = MethodAttributes.Public ) : IMethodBuilder
attributes MethodAttributes attributes for the constructor (public, private, etc.)
Résultat IMethodBuilder

CreateDefaultProperty() public méthode

Creates a default property (ex int Property{get;set;}
public CreateDefaultProperty ( string name, Type propertyType, PropertyAttributes attributes = PropertyAttributes.SpecialName, MethodAttributes getMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, MethodAttributes setMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, IEnumerable parameters = null ) : IPropertyBuilder
name string name of the property
propertyType System.Type Type of the property
attributes PropertyAttributes attributes for the property (special name, etc.)
getMethodAttributes MethodAttributes Get method's attributes (public, private, etc.)
setMethodAttributes MethodAttributes Set method's attributes (public, private, etc.)
parameters IEnumerable Parameter types
Résultat IPropertyBuilder

CreateField() public méthode

Creates a field
public CreateField ( string name, Type fieldType, FieldAttributes attributes = FieldAttributes.Public ) : FieldBuilder
name string name of the field
fieldType System.Type Type of the field
attributes FieldAttributes attributes for the field (public, private, etc.)
Résultat FieldBuilder

CreateMethod() public méthode

Creates a method
public CreateMethod ( string name, MethodAttributes attributes = MethodAttributes.Public|MethodAttributes.Virtual, Type returnType = null, IEnumerable parameterTypes = null ) : IMethodBuilder
name string Method name
attributes MethodAttributes attributes for the method (public, virtual, etc.)
returnType System.Type Return type
parameterTypes IEnumerable Parameter types
Résultat IMethodBuilder

CreateProperty() public méthode

Creates a property
public CreateProperty ( string name, Type propertyType, PropertyAttributes attributes = PropertyAttributes.SpecialName, MethodAttributes getMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, MethodAttributes setMethodAttributes = MethodAttributes.Public|MethodAttributes.Virtual, IEnumerable parameters = null ) : IPropertyBuilder
name string name of the property
propertyType System.Type Type of the property
attributes PropertyAttributes attributes for the property (special name, etc.)
getMethodAttributes MethodAttributes Get method's attributes (public, private, etc.)
setMethodAttributes MethodAttributes Set method's attributes (public, private, etc.)
parameters IEnumerable Parameter types
Résultat IPropertyBuilder

ToString() public méthode

Writes out the type builder to a readable string
public ToString ( ) : string
Résultat string

TypeBuilder() public méthode

Constructor
public TypeBuilder ( Assembly assembly, string name, IEnumerable interfaces, Type baseClass, TypeAttributes attributes ) : System
assembly Assembly Assembly to generate the type within
name string name of the type
interfaces IEnumerable Interfaces that the type implements
baseClass System.Type Base class for the type
attributes TypeAttributes attributes for the type (public, private, etc.)
Résultat System