protected ProxyBase(object baseObject, IInvocationInterceptor invocationInterceptor) { CheckConstructorArguments(baseObject, invocationInterceptor); this.baseObject = baseObject; this.invocationInterceptor = invocationInterceptor; }
internal static void CheckConstructorArguments(object baseObject, IInvocationInterceptor invocationInterceptor) { if (baseObject == null) { throw new ArgumentNullException("baseObject"); } if (invocationInterceptor == null) { throw new ArgumentNullException("invocationInterceptor"); } }
public T CreateDelegateProxy <T>(object baseObject, IInvocationInterceptor invocationInterceptor) { ProxyBase <T> .CheckConstructorArguments(baseObject, invocationInterceptor); var delegateType = typeof(T); if (!delegateType.IsDelegateType()) { throw new ArgumentException(string.Format("{0} is not an delegate", delegateType)); } var proxyType = proxyTypeCache.GetProxyType(delegateType, CreateProxyTypeForDelegate); return((T)CreateDelegate(proxyType, delegateType, baseObject, invocationInterceptor)); }
public T CreateInterfaceProxy <T>(object baseObject, IInvocationInterceptor invocationInterceptor) { ProxyBase <T> .CheckConstructorArguments(baseObject, invocationInterceptor); var interfaceType = typeof(T); if (!interfaceType.IsInterface) { throw new ArgumentException(string.Format("{0} is not an interface", interfaceType)); } var proxyType = proxyTypeCache.GetProxyType(interfaceType, CreateProxyTypeForInterface); return((T)CreateInstance(proxyType, baseObject, invocationInterceptor)); }
public virtual void OnInvocation(IInvocationInterceptor interceptor) { }
public Target(object baseObject, IInvocationInterceptor invocationInterceptor) : base(baseObject, invocationInterceptor) { }
public Target(IInvocationInterceptor invocationInterceptor) : base(new object(), invocationInterceptor) { }