Summary description for GeneratorContext.
Inheritance: System.Collections.DictionaryBase
Exemplo n.º 1
0
		public virtual object CreateCustomClassProxy(Type baseClass, 
			IInterceptor interceptor, GeneratorContext context,
			params object[] argumentsForConstructor)
		{
			return 	CreateCustomClassProxy(baseClass, interceptor, context, true, argumentsForConstructor);
		}
Exemplo n.º 2
0
		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 );
		}
Exemplo n.º 3
0
		protected virtual object CreateCustomClassProxyInstance(Type type, IInterceptor interceptor, 
			GeneratorContext context, object target)
		{
			return CreateProxyInstance( type, interceptor, target );
		}
Exemplo n.º 4
0
		/// <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 );
		}
Exemplo n.º 5
0
		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 );
		}
Exemplo n.º 6
0
		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 );
		}
Exemplo n.º 7
0
		/// <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 );
		}
Exemplo n.º 8
0
 protected virtual object CreateCustomClassProxyInstance(Type type, IInterceptor interceptor,
                                                         GeneratorContext context, object target)
 {
     return(CreateProxyInstance(type, interceptor, target));
 }
Exemplo n.º 9
0
 public virtual object CreateCustomClassProxy(Type baseClass,
                                              IInterceptor interceptor, GeneratorContext context,
                                              params object[] argumentsForConstructor)
 {
     return(CreateCustomClassProxy(baseClass, interceptor, context, true, argumentsForConstructor));
 }
Exemplo n.º 10
0
        /// <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));
        }
Exemplo n.º 11
0
 /// <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));
 }
Exemplo n.º 12
0
 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));
 }
Exemplo n.º 13
0
        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));
        }
Exemplo n.º 14
0
 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));
 }