C# Class Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator

Afficher le fichier Open project: nats/castle-1.0.3-mono

Protected Properties

Свойство Type Description
_baseType System.Type
_cachedFields System.Collections.ArrayList
_interface2mixinIndex System.Collections.Specialized.HybridDictionary
_method2Delegate System.Collections.Hashtable
_method2Invocation Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod
_mixins object[]

Méthodes publiques

Méthode Description
NoFilterImpl ( Type type, object criteria ) : bool

Méthodes protégées

Méthode Description
AddISerializable ( Type interfaces ) : System.Type[]
AddInterfaces ( Type interfacesToAdd, Type interfaces ) : System.Type[]
BaseCodeGenerator ( ModuleScope moduleScope ) : System
BaseCodeGenerator ( ModuleScope moduleScope, GeneratorContext context ) : System
CreateProperty ( PropertyInfo property ) : EasyProperty

Generate property implementation

CreateType ( ) : Type
CreateTypeBuilder ( String typeName, Type baseType, Type interfaces ) : EasyType
CustomizeGetObjectData ( Castle.DynamicProxy.Builder.CodeBuilder.AbstractCodeBuilder codebuilder, ArgumentReference arg1, ArgumentReference arg2 ) : void
Filter ( Type mixinInterfaces ) : System.Type[]
GenerateCallbackMethodIfNecessary ( MethodInfo method, Reference invocationTarget ) : MethodInfo
GenerateConstructor ( ) : EasyConstructor

Generates one public constructor receiving the IInterceptor instance and instantiating a hashtable

Should be overrided to provided specific semantics, if necessary

GenerateConstructorCode ( ConstructorCodeBuilder codebuilder, Reference interceptorArg, Reference targetArgument, Reference mixinArray ) : void

Common initializatio code for the default constructor

GenerateFields ( ) : void
GenerateInterfaceImplementation ( Type interfaces ) : void

GenerateMethodImplementation ( MethodInfo method, EasyProperty properties ) : void

Generates implementation for each method.

GenerateMethods ( Type inter, EasyProperty properties ) : void
GenerateProperties ( Type inter ) : Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty[]
GenerateTypeImplementation ( Type type, bool ignoreInterfaces ) : void

Iterates over the interfaces and generate implementation for each method in it.

GenerateTypeName ( Type type, Type interfaces ) : String
GetCorrectMethod ( MethodInfo method ) : MethodInfo
GetFromCache ( Type baseClass, Type interfaces ) : Type
GetPseudoInvocationTarget ( MethodInfo method ) : Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.Expression
GetTypeName ( Type type ) : String

Gets the name of a type, taking into consideration nested types.

ImplementCacheInvocationCache ( ) : void
ImplementGetObjectData ( Type interfaces ) : void
InspectAndRegisterInterfaces ( object mixins ) : System.Type[]
IsInternalToDynamicProxy ( Assembly asm ) : bool
NormalizeNamespaceName ( String nsName ) : String

Naive implementation, but valid for long namespaces Works by using only the last piece of the namespace

ObtainAvailableConstructor ( Type target ) : ConstructorInfo
ObtainCallableFieldBuilderDelegate ( EasyCallable builder ) : FieldReference
PostProcessMethod ( MethodInfo method ) : void
PreProcessMethod ( MethodInfo method ) : void
RegisterDelegateFieldToBeInitialized ( MethodInfo method, FieldReference field, EasyCallable builder, MethodInfo callbackMethod ) : void
RegisterInCache ( Type generatedType ) : void
WriteInterceptorInvocationMethod ( MethodInfo method, Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod builder ) : void

Writes the method implementation. This method generates the IL code for property get/set method and ordinary methods.

Private Methods

Méthode Description
ObtainMethodAttributes ( MethodInfo method ) : MethodAttributes

Method Details

AddISerializable() protected méthode

protected AddISerializable ( Type interfaces ) : System.Type[]
interfaces System.Type
Résultat System.Type[]

AddInterfaces() protected méthode

protected AddInterfaces ( Type interfacesToAdd, Type interfaces ) : System.Type[]
interfacesToAdd System.Type
interfaces System.Type
Résultat System.Type[]

BaseCodeGenerator() protected méthode

protected BaseCodeGenerator ( ModuleScope moduleScope ) : System
moduleScope ModuleScope
Résultat System

BaseCodeGenerator() protected méthode

protected BaseCodeGenerator ( ModuleScope moduleScope, GeneratorContext context ) : System
moduleScope ModuleScope
context GeneratorContext
Résultat System

CreateProperty() protected méthode

Generate property implementation
protected CreateProperty ( PropertyInfo property ) : EasyProperty
property System.Reflection.PropertyInfo
Résultat Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty

CreateType() protected méthode

protected CreateType ( ) : Type
Résultat System.Type

CreateTypeBuilder() protected méthode

protected CreateTypeBuilder ( String typeName, Type baseType, Type interfaces ) : EasyType
typeName String
baseType System.Type
interfaces System.Type
Résultat Castle.DynamicProxy.Builder.CodeBuilder.EasyType

CustomizeGetObjectData() protected méthode

protected CustomizeGetObjectData ( Castle.DynamicProxy.Builder.CodeBuilder.AbstractCodeBuilder codebuilder, ArgumentReference arg1, ArgumentReference arg2 ) : void
codebuilder Castle.DynamicProxy.Builder.CodeBuilder.AbstractCodeBuilder
arg1 Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.ArgumentReference
arg2 Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.ArgumentReference
Résultat void

Filter() protected méthode

protected Filter ( Type mixinInterfaces ) : System.Type[]
mixinInterfaces System.Type
Résultat System.Type[]

GenerateCallbackMethodIfNecessary() protected méthode

protected GenerateCallbackMethodIfNecessary ( MethodInfo method, Reference invocationTarget ) : MethodInfo
method System.Reflection.MethodInfo
invocationTarget Reference
Résultat System.Reflection.MethodInfo

GenerateConstructor() protected méthode

Generates one public constructor receiving the IInterceptor instance and instantiating a hashtable
Should be overrided to provided specific semantics, if necessary
protected GenerateConstructor ( ) : EasyConstructor
Résultat Castle.DynamicProxy.Builder.CodeBuilder.EasyConstructor

GenerateConstructorCode() protected méthode

Common initializatio code for the default constructor
protected GenerateConstructorCode ( ConstructorCodeBuilder codebuilder, Reference interceptorArg, Reference targetArgument, Reference mixinArray ) : void
codebuilder Castle.DynamicProxy.Builder.CodeBuilder.ConstructorCodeBuilder
interceptorArg Reference
targetArgument Reference
mixinArray Reference
Résultat void

GenerateFields() protected méthode

protected GenerateFields ( ) : void
Résultat void

GenerateInterfaceImplementation() protected méthode

protected GenerateInterfaceImplementation ( Type interfaces ) : void
interfaces System.Type
Résultat void

GenerateMethodImplementation() protected méthode

Generates implementation for each method.
protected GenerateMethodImplementation ( MethodInfo method, EasyProperty properties ) : void
method System.Reflection.MethodInfo
properties Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty
Résultat void

GenerateMethods() protected méthode

protected GenerateMethods ( Type inter, EasyProperty properties ) : void
inter System.Type
properties Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty
Résultat void

GenerateProperties() protected méthode

protected GenerateProperties ( Type inter ) : Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty[]
inter System.Type
Résultat Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty[]

GenerateTypeImplementation() protected méthode

Iterates over the interfaces and generate implementation for each method in it.
protected GenerateTypeImplementation ( Type type, bool ignoreInterfaces ) : void
type System.Type Type class
ignoreInterfaces bool if true, we inspect the /// type for implemented interfaces
Résultat void

GenerateTypeName() protected abstract méthode

protected abstract GenerateTypeName ( Type type, Type interfaces ) : String
type System.Type
interfaces System.Type
Résultat String

GetCorrectMethod() protected méthode

protected GetCorrectMethod ( MethodInfo method ) : MethodInfo
method System.Reflection.MethodInfo
Résultat System.Reflection.MethodInfo

GetFromCache() protected méthode

protected GetFromCache ( Type baseClass, Type interfaces ) : Type
baseClass System.Type
interfaces System.Type
Résultat System.Type

GetPseudoInvocationTarget() protected méthode

protected GetPseudoInvocationTarget ( MethodInfo method ) : Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.Expression
method System.Reflection.MethodInfo
Résultat Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.Expression

GetTypeName() protected méthode

Gets the name of a type, taking into consideration nested types.
protected GetTypeName ( Type type ) : String
type System.Type
Résultat String

ImplementCacheInvocationCache() protected méthode

protected ImplementCacheInvocationCache ( ) : void
Résultat void

ImplementGetObjectData() protected méthode

protected ImplementGetObjectData ( Type interfaces ) : void
interfaces System.Type
Résultat void

InspectAndRegisterInterfaces() protected méthode

protected InspectAndRegisterInterfaces ( object mixins ) : System.Type[]
mixins object
Résultat System.Type[]

IsInternalToDynamicProxy() protected méthode

protected IsInternalToDynamicProxy ( Assembly asm ) : bool
asm System.Reflection.Assembly
Résultat bool

NoFilterImpl() public static méthode

public static NoFilterImpl ( Type type, object criteria ) : bool
type System.Type
criteria object
Résultat bool

NormalizeNamespaceName() protected méthode

Naive implementation, but valid for long namespaces Works by using only the last piece of the namespace
protected NormalizeNamespaceName ( String nsName ) : String
nsName String
Résultat String

ObtainAvailableConstructor() protected méthode

protected ObtainAvailableConstructor ( Type target ) : ConstructorInfo
target System.Type
Résultat System.Reflection.ConstructorInfo

ObtainCallableFieldBuilderDelegate() protected méthode

protected ObtainCallableFieldBuilderDelegate ( EasyCallable builder ) : FieldReference
builder Castle.DynamicProxy.Builder.CodeBuilder.EasyCallable
Résultat Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.FieldReference

PostProcessMethod() protected méthode

protected PostProcessMethod ( MethodInfo method ) : void
method System.Reflection.MethodInfo
Résultat void

PreProcessMethod() protected méthode

protected PreProcessMethod ( MethodInfo method ) : void
method System.Reflection.MethodInfo
Résultat void

RegisterDelegateFieldToBeInitialized() protected méthode

protected RegisterDelegateFieldToBeInitialized ( MethodInfo method, FieldReference field, EasyCallable builder, MethodInfo callbackMethod ) : void
method System.Reflection.MethodInfo
field Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.FieldReference
builder Castle.DynamicProxy.Builder.CodeBuilder.EasyCallable
callbackMethod System.Reflection.MethodInfo
Résultat void

RegisterInCache() protected méthode

protected RegisterInCache ( Type generatedType ) : void
generatedType System.Type
Résultat void

WriteInterceptorInvocationMethod() protected méthode

Writes the method implementation. This method generates the IL code for property get/set method and ordinary methods.
protected WriteInterceptorInvocationMethod ( MethodInfo method, Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod builder ) : void
method System.Reflection.MethodInfo The method to implement.
builder Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod being constructed.
Résultat void

Property Details

_baseType protected_oe property

protected Type,System _baseType
Résultat System.Type

_cachedFields protected_oe property

Holds instance fields which points to delegates instantiated
protected ArrayList,System.Collections _cachedFields
Résultat System.Collections.ArrayList

_interface2mixinIndex protected_oe property

protected HybridDictionary,System.Collections.Specialized _interface2mixinIndex
Résultat System.Collections.Specialized.HybridDictionary

_method2Delegate protected_oe property

MethodInfo => Callable delegate
protected Hashtable,System.Collections _method2Delegate
Résultat System.Collections.Hashtable

_method2Invocation protected_oe property

protected EasyMethod,Castle.DynamicProxy.Builder.CodeBuilder _method2Invocation
Résultat Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod

_mixins protected_oe property

protected object[] _mixins
Résultat object[]