예제 #1
0
 public RelationalOperatorMethod(CSharpOperators operators, Func <T1, T2, bool> func)
     : base(operators.compilation)
 {
     this.ReturnType = operators.compilation.FindType(KnownTypeCode.Boolean);
     this.Parameters.Add(operators.MakeParameter(Type.GetTypeCode(typeof(T1))));
     this.Parameters.Add(operators.MakeParameter(Type.GetTypeCode(typeof(T2))));
     this.func = func;
 }
예제 #2
0
 public StringConcatenation(CSharpOperators operators, TypeCode p1, TypeCode p2)
     : base(operators.compilation)
 {
     this.canEvaluateAtCompileTime = p1 == TypeCode.String && p2 == TypeCode.String;
     this.ReturnType = operators.compilation.FindType(KnownTypeCode.String);
     this.Parameters.Add(operators.MakeParameter(p1));
     this.Parameters.Add(operators.MakeParameter(p2));
 }
예제 #3
0
 public EqualityOperatorMethod(CSharpOperators operators, TypeCode type, bool negate)
     : base(operators.compilation)
 {
     this.Negate     = negate;
     this.Type       = type;
     this.ReturnType = operators.compilation.FindType(KnownTypeCode.Boolean);
     this.Parameters.Add(operators.MakeParameter(type));
     this.Parameters.Add(operators.MakeParameter(type));
 }
예제 #4
0
            public LambdaBinaryOperatorMethod(CSharpOperators operators, Func <T1, T2, T1> checkedFunc, Func <T1, T2, T1> uncheckedFunc)
                : base(operators.compilation)
            {
                TypeCode t1 = Type.GetTypeCode(typeof(T1));

                this.ReturnType = operators.compilation.FindType(t1);
                this.Parameters.Add(operators.MakeParameter(t1));
                this.Parameters.Add(operators.MakeParameter(Type.GetTypeCode(typeof(T2))));
                this.checkedFunc   = checkedFunc;
                this.uncheckedFunc = uncheckedFunc;
            }
예제 #5
0
            public LambdaUnaryOperatorMethod(CSharpOperators operators, Func <T, T> func)
                : base(operators.compilation)
            {
                TypeCode typeCode = Type.GetTypeCode(typeof(T));

                this.ReturnType = operators.compilation.FindType(typeCode);
                this.Parameters.Add(operators.MakeParameter(typeCode));
                this.func = func;
            }