コード例 #1
0
        internal static object InvokeUserDefinedOperator(Symbols.UserDefinedOperator Op, object[] Arguments)
        {
            CallSiteBinder binder;
            ExpressionType?nullable = IDOUtils.LinqOperator(Op);

            if (!nullable.HasValue)
            {
                return(Operators.InvokeObjectUserDefinedOperator(Op, Arguments));
            }
            ExpressionType linqOp = (ExpressionType)nullable;

            if (Arguments.Length == 1)
            {
                binder = new VBUnaryOperatorBinder(Op, linqOp);
            }
            else
            {
                binder = new VBBinaryOperatorBinder(Op, linqOp);
            }
            object instance = Arguments[0];

            object[] arguments = (Arguments.Length == 1) ? Symbols.NoArguments : new object[] { Arguments[1] };
            return(IDOUtils.CreateFuncCallSiteAndInvoke(binder, instance, arguments));
        }
コード例 #2
0
        public override bool Equals(object _other)
        {
            VBUnaryOperatorBinder binder = _other as VBUnaryOperatorBinder;

            return(((binder != null) && (this._Op == binder._Op)) && (this.Operation == binder.Operation));
        }
コード例 #3
0
 internal static object InvokeUserDefinedOperator(Symbols.UserDefinedOperator Op, object[] Arguments)
 {
     CallSiteBinder binder;
     ExpressionType? nullable = IDOUtils.LinqOperator(Op);
     if (!nullable.HasValue)
     {
         return Operators.InvokeObjectUserDefinedOperator(Op, Arguments);
     }
     ExpressionType linqOp = (ExpressionType) nullable;
     if (Arguments.Length == 1)
     {
         binder = new VBUnaryOperatorBinder(Op, linqOp);
     }
     else
     {
         binder = new VBBinaryOperatorBinder(Op, linqOp);
     }
     object instance = Arguments[0];
     object[] arguments = (Arguments.Length == 1) ? Symbols.NoArguments : new object[] { Arguments[1] };
     return IDOUtils.CreateFuncCallSiteAndInvoke(binder, instance, arguments);
 }