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

ProxyGenerator

public class ProxyGenerator
Provides proxy objects for classes and interfaces.
public ILogger Logger { get; set; }

Gets or sets the ILogger that this ProxyGenerator log to.

public IProxyBuilder ProxyBuilder { get; }

Gets the proxy builder instance used to generate proxy types.

public ProxyGenerator(IProxyBuilder builder)

Initializes a new instance of the ProxyGenerator class.

public ProxyGenerator()

Initializes a new instance of the ProxyGenerator class.

public ProxyGenerator(bool disableSignedModule)

Initializes a new instance of the ProxyGenerator class.

protected List<object> BuildArgumentListForClassProxy(ProxyGenerationOptions options, IInterceptor[] interceptors)

protected List<object> BuildArgumentListForClassProxyWithTarget(object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

protected void CheckNotGenericTypeDefinition(Type type, string argumentName)

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

public TClass CreateClassProxy<TClass>(IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type TClass on newly created instance of that type with given interceptors.

public TClass CreateClassProxy<TClass>(ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type TClass on newly created instance of that type with given interceptors.

public object CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxy(Type classToProxy, ProxyGenerationOptions options, object[] constructorArguments, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxy(Type classToProxy, object[] constructorArguments, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxy(Type classToProxy, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxy(Type classToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public virtual object CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, object[] constructorArguments, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

protected object CreateClassProxyInstance(Type proxyType, List<object> proxyArguments, Type classToProxy, object[] constructorArguments)

protected Type CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)

Creates the proxy type for class proxy with given classToProxy class, implementing given additionalInterfacesToProxy and using provided options.

protected Type CreateClassProxyTypeWithTarget(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)

public TClass CreateClassProxyWithTarget<TClass>(TClass target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type TClass on newly created instance of that type with given interceptors.

public TClass CreateClassProxyWithTarget<TClass>(TClass target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type TClass on newly created instance of that type with given interceptors.

public object CreateClassProxyWithTarget(Type classToProxy, Type[] additionalInterfacesToProxy, object target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxyWithTarget(Type classToProxy, object target, ProxyGenerationOptions options, object[] constructorArguments, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxyWithTarget(Type classToProxy, object target, object[] constructorArguments, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxyWithTarget(Type classToProxy, object target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxyWithTarget(Type classToProxy, object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public object CreateClassProxyWithTarget(Type classToProxy, Type[] additionalInterfacesToProxy, object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

public virtual object CreateClassProxyWithTarget(Type classToProxy, Type[] additionalInterfacesToProxy, object target, ProxyGenerationOptions options, object[] constructorArguments, IInterceptor[] interceptors)

Creates proxy object intercepting calls to virtual members of type classToProxy on newly created instance of that type with given interceptors.

protected Type CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)

Creates the proxy type for interface proxy without target for given interfaceToProxy interface, implementing given additionalInterfacesToProxy and using provided options.

protected Type CreateInterfaceProxyTypeWithTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, Type targetType, ProxyGenerationOptions options)

Creates the proxy type for interface proxy with target for given interfaceToProxy interface, implementing given additionalInterfacesToProxy on given targetType and using provided options.

protected Type CreateInterfaceProxyTypeWithTargetInterface(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)

Creates the proxy type for interface proxy with target interface for given interfaceToProxy interface, implementing given additionalInterfacesToProxy on given interfaceToProxy and using provided options.

public TInterface CreateInterfaceProxyWithoutTarget<TInterface>(IInterceptor interceptor)

Creates proxy object intercepting calls to members of interface TInterface on target object generated at runtime with given interceptor.

public TInterface CreateInterfaceProxyWithoutTarget<TInterface>(IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface TInterface on target object generated at runtime with given interceptors.

public TInterface CreateInterfaceProxyWithoutTarget<TInterface>(ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface TInterface on target object generated at runtime with given interceptors.

public object CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, IInterceptor interceptor)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object generated at runtime with given interceptor.

public object CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object generated at runtime with given interceptors.

public object CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object generated at runtime with given interceptors.

public object CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object generated at runtime with given interceptors.

public virtual object CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object generated at runtime with given interceptors.

public TInterface CreateInterfaceProxyWithTarget<TInterface>(TInterface target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface TInterface on target object with given interceptors.

public TInterface CreateInterfaceProxyWithTarget<TInterface>(TInterface target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface TInterface on target object with given interceptors.

public object CreateInterfaceProxyWithTarget(Type interfaceToProxy, object target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors.

public object CreateInterfaceProxyWithTarget(Type interfaceToProxy, object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors.

public object CreateInterfaceProxyWithTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, object target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors.

public virtual object CreateInterfaceProxyWithTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors.

public object CreateInterfaceProxyWithTargetInterface(Type interfaceToProxy, object target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors. Interceptors can use IChangeProxyTarget interface to provide other target for method invocation than default target.

public TInterface CreateInterfaceProxyWithTargetInterface<TInterface>(TInterface target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface TInterface on target object with given interceptors. Interceptors can use IChangeProxyTarget interface to provide other target for method invocation than default target.

public TInterface CreateInterfaceProxyWithTargetInterface<TInterface>(TInterface target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface TInterface on target object with given interceptors. Interceptors can use IChangeProxyTarget interface to provide other target for method invocation than default target.

public object CreateInterfaceProxyWithTargetInterface(Type interfaceToProxy, Type[] additionalInterfacesToProxy, object target, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors. Interceptors can use IChangeProxyTarget interface to provide other target for method invocation than default target.

public object CreateInterfaceProxyWithTargetInterface(Type interfaceToProxy, object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors. Interceptors can use IChangeProxyTarget interface to provide other target for method invocation than default target.

public virtual object CreateInterfaceProxyWithTargetInterface(Type interfaceToProxy, Type[] additionalInterfacesToProxy, object target, ProxyGenerationOptions options, IInterceptor[] interceptors)

Creates proxy object intercepting calls to members of interface interfaceToProxy on target object with given interceptors. Interceptors can use IChangeProxyTarget interface to provide other target for method invocation than default target.

protected List<object> GetConstructorArguments(object target, IInterceptor[] interceptors, ProxyGenerationOptions options)