<PackageReference Include="Castle.Core" Version="5.1.1" />

BaseProxyGenerator

abstract class BaseProxyGenerator
Base class that exposes the common functionalities to proxy generation.
protected readonly Type[] interfaces

protected readonly Type targetType

public ILogger Logger { get; set; }

protected ModuleScope Scope { get; }

protected BaseProxyGenerator(ModuleScope scope, Type targetType, Type[] interfaces, ProxyGenerationOptions proxyGenerationOptions)

protected void AddMapping(Type interface, ITypeContributor implementer, IDictionary<Type, ITypeContributor> mapping)

protected void AddMappingNoCheck(Type interface, ITypeContributor implementer, IDictionary<Type, ITypeContributor> mapping)

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

protected virtual ClassEmitter BuildClassEmitter(string typeName, Type parentType, IEnumerable<Type> interfaces)

protected void CheckNotGenericTypeDefinition(Type type, string argumentName)

protected void CheckNotGenericTypeDefinitions(IEnumerable<Type> types, string argumentName)

protected void CompleteInitCacheMethod(CodeBuilder constCodeBuilder)

protected virtual void CreateFields(ClassEmitter emitter)

protected void CreateInterceptorsField(ClassEmitter emitter)

protected void CreateSelectorField(ClassEmitter emitter)

protected virtual void CreateTypeAttributes(ClassEmitter emitter)

protected void GenerateConstructor(ClassEmitter emitter, ConstructorInfo baseConstructor, FieldReference[] fields)

protected void GenerateConstructors(ClassEmitter emitter, Type baseType, FieldReference[] fields)

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

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 abstract Type GenerateType(string name, INamingScope namingScope)

protected abstract CacheKey GetCacheKey()

public Type GetProxyType()

protected void InitializeStaticFields(Type builtType)