<PackageReference Include="Castle.Core" Version="4.0.0-beta001" />

BaseProxyGenerator

public abstract class BaseProxyGenerator
Base class that exposes the common functionalities to proxy generation.
protected readonly Type targetType

public ILogger Logger { get; set; }

protected ProxyGenerationOptions ProxyGenerationOptions { get; protected set; }

protected ModuleScope Scope { get; }

protected BaseProxyGenerator(ModuleScope scope, Type targetType)

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 void AddToCache(CacheKey key, Type type)

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(ConstructorCodeBuilder 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 Type GetFromCache(CacheKey key)

protected void HandleExplicitlyPassedProxyTargetAccessor(ICollection<Type> targetInterfaces, ICollection<Type> additionalInterfaces)

protected void InitializeStaticFields(Type builtType)

protected Type ObtainProxyType(CacheKey cacheKey, Func<string, INamingScope, Type> factory)