public virtual object CreateCustomClassProxy(Type baseClass, IInterceptor interceptor, GeneratorContext context, params object[] argumentsForConstructor) { return CreateCustomClassProxy(baseClass, interceptor, context, true, argumentsForConstructor); }
protected virtual object CreateCustomClassProxyInstance(Type type, IInterceptor interceptor, GeneratorContext context, params object[] argumentsForConstructor) { if (context.HasMixins) { ArrayList args = new ArrayList(); args.Add(interceptor); args.Add(context.MixinsAsArray()); args.AddRange(argumentsForConstructor); return Activator.CreateInstance( type, args.ToArray() ); } return CreateClassProxyInstance( type, interceptor, argumentsForConstructor ); }
protected virtual object CreateCustomClassProxyInstance(Type type, IInterceptor interceptor, GeneratorContext context, object target) { return CreateProxyInstance( type, interceptor, target ); }
/// <summary> /// /// </summary> /// <param name="interfaces"></param> /// <param name="interceptor"></param> /// <param name="context"></param> /// <param name="target">The proxy target.</param> /// <returns></returns> public virtual object CreateCustomProxy(Type[] interfaces, IInterceptor interceptor, object target, GeneratorContext context ) { AssertUtil.IsInterface(interfaces, "interfaces"); AssertUtil.NotNull(interceptor, "interceptor"); AssertUtil.NotNull(target, "target"); AssertUtil.NotNull(context, "context"); Type newType = ProxyBuilder.CreateCustomInterfaceProxy(interfaces, target.GetType(), context); return CreateCustomProxyInstance( newType, interceptor, target, context ); }
protected virtual object CreateCustomProxyInstance(Type type, IInterceptor interceptor, object target, GeneratorContext context) { if (context.HasMixins) { return Activator.CreateInstance( type, new object[] { interceptor, target, context.MixinsAsArray() } ); } return CreateProxyInstance( type, interceptor, target ); }
public virtual object CreateCustomClassProxy(Type baseClass, IInterceptor interceptor, GeneratorContext context, bool checkAbstract, params object[] argumentsForConstructor) { AssertUtil.IsClass(baseClass, "baseClass", checkAbstract); AssertUtil.NotNull(interceptor, "interceptor"); AssertUtil.NotNull(context, "context"); Type newType = ProxyBuilder.CreateCustomClassProxy(baseClass, context); return CreateCustomClassProxyInstance( newType, interceptor, context, argumentsForConstructor ); }
/// <summary> /// /// </summary> /// <param name="theInterface"></param> /// <param name="interceptor"></param> /// <param name="context"></param> /// <param name="target">The proxy target.</param> /// <returns></returns> public virtual object CreateCustomProxy(Type theInterface, IInterceptor interceptor, object target, GeneratorContext context ) { return CreateCustomProxy( new Type[] { theInterface }, interceptor, target, context ); }
protected virtual object CreateCustomClassProxyInstance(Type type, IInterceptor interceptor, GeneratorContext context, object target) { return(CreateProxyInstance(type, interceptor, target)); }
public virtual object CreateCustomClassProxy(Type baseClass, IInterceptor interceptor, GeneratorContext context, params object[] argumentsForConstructor) { return(CreateCustomClassProxy(baseClass, interceptor, context, true, argumentsForConstructor)); }
/// <summary> /// /// </summary> /// <param name="interfaces"></param> /// <param name="interceptor"></param> /// <param name="context"></param> /// <param name="target">The proxy target.</param> /// <returns></returns> public virtual object CreateCustomProxy(Type[] interfaces, IInterceptor interceptor, object target, GeneratorContext context) { AssertUtil.IsInterface(interfaces, "interfaces"); AssertUtil.NotNull(interceptor, "interceptor"); AssertUtil.NotNull(target, "target"); AssertUtil.NotNull(context, "context"); Type newType = ProxyBuilder.CreateCustomInterfaceProxy(interfaces, target.GetType(), context); return(CreateCustomProxyInstance(newType, interceptor, target, context)); }
/// <summary> /// /// </summary> /// <param name="theInterface"></param> /// <param name="interceptor"></param> /// <param name="context"></param> /// <param name="target">The proxy target.</param> /// <returns></returns> public virtual object CreateCustomProxy(Type theInterface, IInterceptor interceptor, object target, GeneratorContext context) { return(CreateCustomProxy(new Type[] { theInterface }, interceptor, target, context)); }
protected virtual object CreateCustomClassProxyInstance(Type type, IInterceptor interceptor, GeneratorContext context, params object[] argumentsForConstructor) { if (context.HasMixins) { ArrayList list = new ArrayList(); list.Add(interceptor); list.Add(context.MixinsAsArray()); list.AddRange(argumentsForConstructor); return(Activator.CreateInstance(type, list.ToArray())); } return(this.CreateClassProxyInstance(type, interceptor, argumentsForConstructor)); }
public virtual object CreateCustomClassProxy(Type baseClass, IInterceptor interceptor, GeneratorContext context, bool checkAbstract, params object[] argumentsForConstructor) { AssertUtil.IsClass(baseClass, "baseClass", checkAbstract); AssertUtil.NotNull(interceptor, "interceptor"); AssertUtil.NotNull(context, "context"); Type type = this.ProxyBuilder.CreateCustomClassProxy(baseClass, context); return(this.CreateCustomClassProxyInstance(type, interceptor, context, argumentsForConstructor)); }
protected virtual object CreateCustomProxyInstance(Type type, IInterceptor interceptor, object target, GeneratorContext context) { if (context.HasMixins) { return(Activator.CreateInstance(type, new object[] { interceptor, target, context.MixinsAsArray() })); } return(this.CreateProxyInstance(type, interceptor, target)); }