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

ProxyGenerationOptions

public class ProxyGenerationOptions
ProxyGenerationOptions allows customization of the behavior of proxies created by an IProxyGenerator (or proxy types generated by an IProxyBuilder).

You should not modify an instance of ProxyGenerationOptions once it has been used to create a proxy (or proxy type).

public static readonly ProxyGenerationOptions Default

Gets the collection of additional custom attributes that will be put on generated proxy types. This collection is initially empty.

You should not modify this collection once this ProxyGenerationOptions instance has been used to create a proxy.

public Type BaseTypeForInterfaceProxy { get; set; }

Gets or sets the class type from which generated interface proxy types will be derived. Defaults to typeof(object).

You should not modify this property once this ProxyGenerationOptions instance has been used to create a proxy.

public bool HasMixins { get; }

public IProxyGenerationHook Hook { get; set; }

Gets or sets the IProxyGenerationHook that should be used during proxy type generation. Defaults to an instance of AllMethodsHook.

You should not modify this property once this ProxyGenerationOptions instance has been used to create a proxy.

public MixinData MixinData { get; }

public IInterceptorSelector Selector { get; set; }

Gets or sets the IInterceptorSelector that should be used by created proxies to determine which interceptors to use for an interception. If set to null (which is the default), created proxies will not use any selector.

You should not modify this property once this ProxyGenerationOptions instance has been used to create a proxy.

Initializes a new instance of the ProxyGenerationOptions class.

Initializes a new instance of the ProxyGenerationOptions class.

public void AddDelegateMixin(Delegate delegate)

Adds a delegate to be mixed into generated proxies. The delegate will act as the target for calls to a `Invoke` method with a signature matching that of the delegate.

You should not call this method once this ProxyGenerationOptions instance has been used to create a proxy.

public void AddDelegateTypeMixin(Type delegateType)

Adds a delegate type to the list of mixins that will be added to generated proxies. That is, generated proxies will have a `Invoke` method with a signature matching that of the specified delegateType.

You should not call this method once this ProxyGenerationOptions instance has been used to create a proxy.

public void AddMixinInstance(object instance)

Mixes the interfaces implemented by the specified instance object into created proxies, and uses instance as the target for these mixed-in interfaces.

You should not call this method once this ProxyGenerationOptions instance has been used to create a proxy.

public void Initialize()

public object[] MixinsAsArray()