C# Class Castle.DynamicProxy.Generators.BaseProxyGenerator

Base class that exposes the common functionalities to proxy generation.
TODO: - Add tests and fixes for 'leaking this' problem
ファイルを表示 Open project: Jarvin-Guan/CleanAOP

Protected Properties

Property Type Description
targetType Type

Protected Methods

Method Description
AddMapping ( Type @interface, ITypeContributor implementer, ITypeContributor>.IDictionary mapping ) : void
AddMappingForISerializable ( ITypeContributor>.IDictionary typeImplementerMapping, ITypeContributor instance ) : void
AddMappingNoCheck ( Type @interface, ITypeContributor implementer, ITypeContributor>.IDictionary mapping ) : void

It is safe to add mapping (no mapping for the interface exists)

AddToCache ( CacheKey key, Type type ) : void
BaseProxyGenerator ( ModuleScope scope, Type targetType ) : System
BuildClassEmitter ( string typeName, Type parentType, IEnumerable interfaces ) : ClassEmitter
CheckNotGenericTypeDefinition ( Type type, string argumentName ) : void
CheckNotGenericTypeDefinitions ( IEnumerable types, string argumentName ) : void
CompleteInitCacheMethod ( ConstructorCodeBuilder constCodeBuilder ) : void
CreateFields ( ClassEmitter emitter ) : void
CreateInterceptorsField ( ClassEmitter emitter ) : void
CreateOptionsField ( ClassEmitter emitter ) : FieldReference
CreateSelectorField ( ClassEmitter emitter ) : void
CreateTypeAttributes ( ClassEmitter emitter ) : void
EnsureOptionsOverrideEqualsAndGetHashCode ( ProxyGenerationOptions options ) : void
GenerateConstructor ( ClassEmitter emitter, ConstructorInfo baseConstructor ) : void
GenerateConstructors ( ClassEmitter emitter, Type baseType ) : void
GenerateParameterlessConstructor ( ClassEmitter emitter, Type baseClass, FieldReference interceptorField ) : void

Generates a parameters constructor that initializes the proxy state with StandardInterceptor just to make it non-null.

This constructor is important to allow proxies to be XML serializable

GenerateStaticConstructor ( ClassEmitter emitter ) : ConstructorEmitter
GetFromCache ( CacheKey key ) : Type
HandleExplicitlyPassedProxyTargetAccessor ( ICollection targetInterfaces, ICollection additionalInterfaces ) : void
InitializeStaticFields ( Type builtType ) : void
ObtainProxyType ( CacheKey cacheKey, Func factory ) : Type

Private Methods

Method Description
IsConstructorVisible ( ConstructorInfo constructor ) : bool
OverridesEqualsAndGetHashCode ( Type type ) : bool

Method Details

AddMapping() protected method

protected AddMapping ( Type @interface, ITypeContributor implementer, ITypeContributor>.IDictionary mapping ) : void
@interface System.Type
implementer ITypeContributor
mapping ITypeContributor>.IDictionary
return void

AddMappingForISerializable() protected method

protected AddMappingForISerializable ( ITypeContributor>.IDictionary typeImplementerMapping, ITypeContributor instance ) : void
typeImplementerMapping ITypeContributor>.IDictionary
instance ITypeContributor
return void

AddMappingNoCheck() protected method

It is safe to add mapping (no mapping for the interface exists)
protected AddMappingNoCheck ( Type @interface, ITypeContributor implementer, ITypeContributor>.IDictionary mapping ) : void
@interface System.Type
implementer ITypeContributor
mapping ITypeContributor>.IDictionary
return void

AddToCache() protected method

protected AddToCache ( CacheKey key, Type type ) : void
key CacheKey
type Type
return void

BaseProxyGenerator() protected method

protected BaseProxyGenerator ( ModuleScope scope, Type targetType ) : System
scope ModuleScope
targetType Type
return System

BuildClassEmitter() protected method

protected BuildClassEmitter ( string typeName, Type parentType, IEnumerable interfaces ) : ClassEmitter
typeName string
parentType Type
interfaces IEnumerable
return ClassEmitter

CheckNotGenericTypeDefinition() protected method

protected CheckNotGenericTypeDefinition ( Type type, string argumentName ) : void
type Type
argumentName string
return void

CheckNotGenericTypeDefinitions() protected method

protected CheckNotGenericTypeDefinitions ( IEnumerable types, string argumentName ) : void
types IEnumerable
argumentName string
return void

CompleteInitCacheMethod() protected method

protected CompleteInitCacheMethod ( ConstructorCodeBuilder constCodeBuilder ) : void
constCodeBuilder ConstructorCodeBuilder
return void

CreateFields() protected method

protected CreateFields ( ClassEmitter emitter ) : void
emitter ClassEmitter
return void

CreateInterceptorsField() protected method

protected CreateInterceptorsField ( ClassEmitter emitter ) : void
emitter ClassEmitter
return void

CreateOptionsField() protected method

protected CreateOptionsField ( ClassEmitter emitter ) : FieldReference
emitter ClassEmitter
return FieldReference

CreateSelectorField() protected method

protected CreateSelectorField ( ClassEmitter emitter ) : void
emitter ClassEmitter
return void

CreateTypeAttributes() protected method

protected CreateTypeAttributes ( ClassEmitter emitter ) : void
emitter ClassEmitter
return void

EnsureOptionsOverrideEqualsAndGetHashCode() protected method

protected EnsureOptionsOverrideEqualsAndGetHashCode ( ProxyGenerationOptions options ) : void
options ProxyGenerationOptions
return void

GenerateConstructor() protected method

protected GenerateConstructor ( ClassEmitter emitter, ConstructorInfo baseConstructor ) : void
emitter ClassEmitter
baseConstructor ConstructorInfo
return void

GenerateConstructors() protected method

protected GenerateConstructors ( ClassEmitter emitter, Type baseType ) : void
emitter ClassEmitter
baseType Type
return void

GenerateParameterlessConstructor() protected method

Generates a parameters constructor that initializes the proxy state with StandardInterceptor just to make it non-null.

This constructor is important to allow proxies to be XML serializable

protected GenerateParameterlessConstructor ( ClassEmitter emitter, Type baseClass, FieldReference interceptorField ) : void
emitter ClassEmitter
baseClass Type
interceptorField FieldReference
return void

GenerateStaticConstructor() protected method

protected GenerateStaticConstructor ( ClassEmitter emitter ) : ConstructorEmitter
emitter ClassEmitter
return ConstructorEmitter

GetFromCache() protected method

protected GetFromCache ( CacheKey key ) : Type
key CacheKey
return Type

HandleExplicitlyPassedProxyTargetAccessor() protected method

protected HandleExplicitlyPassedProxyTargetAccessor ( ICollection targetInterfaces, ICollection additionalInterfaces ) : void
targetInterfaces ICollection
additionalInterfaces ICollection
return void

InitializeStaticFields() protected method

protected InitializeStaticFields ( Type builtType ) : void
builtType Type
return void

ObtainProxyType() protected method

protected ObtainProxyType ( CacheKey cacheKey, Func factory ) : Type
cacheKey CacheKey
factory Func
return Type

Property Details

targetType protected_oe property

protected Type targetType
return Type