public InterfaceProxyWithOptionalTargetContributor(INamingScope namingScope, GetTargetExpressionDelegate getTarget,
                                                    GetTargetReferenceDelegate getTargetReference)
     : base(namingScope, getTarget)
 {
     this.getTargetReference = getTargetReference;
     canChangeTarget         = true;
 }
 public InterfaceProxyWithOptionalTargetContributor(INamingScope namingScope, GetTargetExpressionDelegate getTarget,
                                                    GetTargetReferenceDelegate getTargetReference)
     : base(namingScope, getTarget)
 {
     this.getTargetReference = getTargetReference;
     canChangeTarget = true;
 }
        protected override MethodGenerator GetMethodGenerator(MetaMethod method, ClassEmitter @class,
                                                              OverrideMethodDelegate overrideMethod)
        {
            if (methodsToSkip.Contains(method.Method))
            {
                return(null);
            }

            if (!method.Proxyable)
            {
                return(new MinimialisticMethodGenerator(method,
                                                        overrideMethod));
            }

            if (ExplicitlyImplementedInterfaceMethod(method))
            {
                return(ExplicitlyImplementedInterfaceMethodGenerator(method, @class, overrideMethod));
            }

            var invocation = GetInvocationType(method, @class);

            GetTargetExpressionDelegate getTargetTypeExpression = (c, m) => new TypeTokenExpression(targetType);

            return(new MethodWithInvocationGenerator(method,
                                                     @class.GetField("__interceptors"),
                                                     invocation,
                                                     getTargetTypeExpression,
                                                     getTargetTypeExpression,
                                                     overrideMethod,
                                                     null));
        }
		public MethodWithInvocationGenerator(MetaMethod method, Reference interceptors, Type invocation, GetTargetExpressionDelegate getTargetExpression, CreateMethodDelegate createMethod)
			: base(method, createMethod)
		{
			this.interceptors = interceptors;
			this.getTargetExpression = getTargetExpression;
			this.invocation = invocation;
		}
 public MethodWithInvocationGenerator(MetaMethod method, Reference interceptors, Type invocation, GetTargetExpressionDelegate getTargetExpression, CreateMethodDelegate createMethod)
     : base(method, createMethod)
 {
     this.interceptors        = interceptors;
     this.getTargetExpression = getTargetExpression;
     this.invocation          = invocation;
 }
Exemple #6
0
 public InterfaceProxyWithoutTargetContributor(
     INamingScope namingScope,
     GetTargetExpressionDelegate getTarget
     ) : base(namingScope)
 {
     getTargetExpression = getTarget;
 }
		public MethodWithInvocationGenerator(MetaMethod method, Reference interceptors, Type invocation, GetTargetExpressionDelegate getTargetExpression, OverrideMethodDelegate createMethod, IInvocationCreationContributor contributor)
			: base(method, createMethod)
		{
			this.invocation = invocation;
			this.getTargetExpression = getTargetExpression;
			this.interceptors = interceptors;
			this.contributor = contributor;
		}
 public MethodWithInvocationGenerator(MetaMethod method, Reference interceptors, Type invocation, GetTargetExpressionDelegate getTargetExpression, OverrideMethodDelegate createMethod, IInvocationCreationContributor contributor)
     : base(method, createMethod)
 {
     this.invocation          = invocation;
     this.getTargetExpression = getTargetExpression;
     this.interceptors        = interceptors;
     this.contributor         = contributor;
 }
 public MethodWithInvocationGenerator(
     MetaMethod method,
     IExpression interceptors,
     Type invocation,
     GetTargetExpressionDelegate getTargetExpression,
     OverrideMethodDelegate createMethod,
     IInvocationCreationContributor contributor
     )
     : this(
         method,
         interceptors,
         invocation,
         getTargetExpression,
         null,
         createMethod,
         contributor
         )
 {
 }
		public InterfaceProxyWithoutTargetContributor(INamingScope namingScope, GetTargetExpressionDelegate getTarget)
			: base(namingScope)
		{
			getTargetExpression = getTarget;
		}
Exemple #11
0
 public MixinContributor(INamingScope namingScope, bool canChangeTarget)
     : base(namingScope)
 {
     this.canChangeTarget = canChangeTarget;
     getTargetExpression  = BuildGetTargetExpression();
 }
Exemple #12
0
 public MixinContributor(INamingScope namingScope, bool canChangeTarget)
     : base(namingScope)
 {
     this.canChangeTarget = canChangeTarget;
     getTargetExpression = BuildGetTargetExpression();
 }