C# Класс Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
_baseType System.Type
_cachedFields System.Collections.ArrayList
_interface2mixinIndex System.Collections.Specialized.HybridDictionary
_method2Delegate System.Collections.Hashtable
_method2Invocation Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod
_mixins object[]

Открытые методы

Метод Описание
NoFilterImpl ( Type type, object criteria ) : bool

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
ObtainMethodAttributes ( MethodInfo method ) : MethodAttributes

Описание методов

AddISerializable() защищенный Метод

protected AddISerializable ( Type interfaces ) : System.Type[]
interfaces System.Type
Результат System.Type[]

AddInterfaces() защищенный Метод

protected AddInterfaces ( Type interfacesToAdd, Type interfaces ) : System.Type[]
interfacesToAdd System.Type
interfaces System.Type
Результат System.Type[]

BaseCodeGenerator() защищенный Метод

protected BaseCodeGenerator ( ModuleScope moduleScope ) : System
moduleScope ModuleScope
Результат System

BaseCodeGenerator() защищенный Метод

protected BaseCodeGenerator ( ModuleScope moduleScope, GeneratorContext context ) : System
moduleScope ModuleScope
context GeneratorContext
Результат System

CreateProperty() защищенный Метод

Generate property implementation
protected CreateProperty ( PropertyInfo property ) : EasyProperty
property System.Reflection.PropertyInfo
Результат Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty

CreateType() защищенный Метод

protected CreateType ( ) : Type
Результат System.Type

CreateTypeBuilder() защищенный Метод

protected CreateTypeBuilder ( String typeName, Type baseType, Type interfaces ) : EasyType
typeName String
baseType System.Type
interfaces System.Type
Результат Castle.DynamicProxy.Builder.CodeBuilder.EasyType

CustomizeGetObjectData() защищенный Метод

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
Результат void

Filter() защищенный Метод

protected Filter ( Type mixinInterfaces ) : System.Type[]
mixinInterfaces System.Type
Результат System.Type[]

GenerateCallbackMethodIfNecessary() защищенный Метод

protected GenerateCallbackMethodIfNecessary ( MethodInfo method, Reference invocationTarget ) : MethodInfo
method System.Reflection.MethodInfo
invocationTarget Reference
Результат System.Reflection.MethodInfo

GenerateConstructor() защищенный Метод

Generates one public constructor receiving the IInterceptor instance and instantiating a hashtable
Should be overrided to provided specific semantics, if necessary
protected GenerateConstructor ( ) : EasyConstructor
Результат Castle.DynamicProxy.Builder.CodeBuilder.EasyConstructor

GenerateConstructorCode() защищенный Метод

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
Результат void

GenerateFields() защищенный Метод

protected GenerateFields ( ) : void
Результат void

GenerateInterfaceImplementation() защищенный Метод

protected GenerateInterfaceImplementation ( Type interfaces ) : void
interfaces System.Type
Результат void

GenerateMethodImplementation() защищенный Метод

Generates implementation for each method.
protected GenerateMethodImplementation ( MethodInfo method, EasyProperty properties ) : void
method System.Reflection.MethodInfo
properties Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty
Результат void

GenerateMethods() защищенный Метод

protected GenerateMethods ( Type inter, EasyProperty properties ) : void
inter System.Type
properties Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty
Результат void

GenerateProperties() защищенный Метод

protected GenerateProperties ( Type inter ) : Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty[]
inter System.Type
Результат Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty[]

GenerateTypeImplementation() защищенный Метод

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
Результат void

GenerateTypeName() защищенный абстрактный Метод

protected abstract GenerateTypeName ( Type type, Type interfaces ) : String
type System.Type
interfaces System.Type
Результат String

GetCorrectMethod() защищенный Метод

protected GetCorrectMethod ( MethodInfo method ) : MethodInfo
method System.Reflection.MethodInfo
Результат System.Reflection.MethodInfo

GetFromCache() защищенный Метод

protected GetFromCache ( Type baseClass, Type interfaces ) : Type
baseClass System.Type
interfaces System.Type
Результат System.Type

GetPseudoInvocationTarget() защищенный Метод

protected GetPseudoInvocationTarget ( MethodInfo method ) : Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.Expression
method System.Reflection.MethodInfo
Результат Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.Expression

GetTypeName() защищенный Метод

Gets the name of a type, taking into consideration nested types.
protected GetTypeName ( Type type ) : String
type System.Type
Результат String

ImplementCacheInvocationCache() защищенный Метод

protected ImplementCacheInvocationCache ( ) : void
Результат void

ImplementGetObjectData() защищенный Метод

protected ImplementGetObjectData ( Type interfaces ) : void
interfaces System.Type
Результат void

InspectAndRegisterInterfaces() защищенный Метод

protected InspectAndRegisterInterfaces ( object mixins ) : System.Type[]
mixins object
Результат System.Type[]

IsInternalToDynamicProxy() защищенный Метод

protected IsInternalToDynamicProxy ( Assembly asm ) : bool
asm System.Reflection.Assembly
Результат bool

NoFilterImpl() публичный статический Метод

public static NoFilterImpl ( Type type, object criteria ) : bool
type System.Type
criteria object
Результат bool

NormalizeNamespaceName() защищенный Метод

Naive implementation, but valid for long namespaces Works by using only the last piece of the namespace
protected NormalizeNamespaceName ( String nsName ) : String
nsName String
Результат String

ObtainAvailableConstructor() защищенный Метод

protected ObtainAvailableConstructor ( Type target ) : ConstructorInfo
target System.Type
Результат System.Reflection.ConstructorInfo

ObtainCallableFieldBuilderDelegate() защищенный Метод

protected ObtainCallableFieldBuilderDelegate ( EasyCallable builder ) : FieldReference
builder Castle.DynamicProxy.Builder.CodeBuilder.EasyCallable
Результат Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.FieldReference

PostProcessMethod() защищенный Метод

protected PostProcessMethod ( MethodInfo method ) : void
method System.Reflection.MethodInfo
Результат void

PreProcessMethod() защищенный Метод

protected PreProcessMethod ( MethodInfo method ) : void
method System.Reflection.MethodInfo
Результат void

RegisterDelegateFieldToBeInitialized() защищенный Метод

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
Результат void

RegisterInCache() защищенный Метод

protected RegisterInCache ( Type generatedType ) : void
generatedType System.Type
Результат void

WriteInterceptorInvocationMethod() защищенный Метод

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.
Результат void

Описание свойств

_baseType защищенное свойство

protected Type,System _baseType
Результат System.Type

_cachedFields защищенное свойство

Holds instance fields which points to delegates instantiated
protected ArrayList,System.Collections _cachedFields
Результат System.Collections.ArrayList

_interface2mixinIndex защищенное свойство

protected HybridDictionary,System.Collections.Specialized _interface2mixinIndex
Результат System.Collections.Specialized.HybridDictionary

_method2Delegate защищенное свойство

MethodInfo => Callable delegate
protected Hashtable,System.Collections _method2Delegate
Результат System.Collections.Hashtable

_method2Invocation защищенное свойство

protected EasyMethod,Castle.DynamicProxy.Builder.CodeBuilder _method2Invocation
Результат Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod

_mixins защищенное свойство

protected object[] _mixins
Результат object[]