Beispiel #1
0
 private static MethodInfo GetHelperMethod(TotemOperator op)
 {
     switch (op)
     {
         default:
             Debug.Assert(false, "Invalid TotemOperator: " + op.ToString());
             return null;
     }
 }
Beispiel #2
0
        private static TotemOperationKind TotemOperatorToAction(TotemOperator op)
        {
            switch (op)
            {
                case TotemOperator.Add: return TotemOperationKind.Add;
                case TotemOperator.Subtract: return TotemOperationKind.Subtract;
                case TotemOperator.Multiply: return TotemOperationKind.Multiply;
                case TotemOperator.Divide: return TotemOperationKind.Divide;
                case TotemOperator.Modulo: return TotemOperationKind.Mod;
                case TotemOperator.BitwiseAnd: return TotemOperationKind.BitwiseAnd;
                case TotemOperator.BitwiseOr: return TotemOperationKind.BitwiseOr;
                case TotemOperator.Xor: return TotemOperationKind.ExclusiveOr;
                case TotemOperator.LeftShift: return TotemOperationKind.LeftShift;
                case TotemOperator.RightShift: return TotemOperationKind.RightShift;
                case TotemOperator.Power: return TotemOperationKind.Power;
                case TotemOperator.FloorDivide: return TotemOperationKind.FloorDivide;

                // Comparisons
                case TotemOperator.LessThan: return TotemOperationKind.LessThan;
                case TotemOperator.LessThanOrEqual: return TotemOperationKind.LessThanOrEqual;
                case TotemOperator.GreaterThan: return TotemOperationKind.GreaterThan;
                case TotemOperator.GreaterThanOrEqual: return TotemOperationKind.GreaterThanOrEqual;
                case TotemOperator.Equal: return TotemOperationKind.Equal;
                case TotemOperator.NotEqual: return TotemOperationKind.NotEqual;

                case TotemOperator.In: return TotemOperationKind.Contains;
                    
                case TotemOperator.NotIn:
                case TotemOperator.IsNot:
                case TotemOperator.Is:
                    return TotemOperationKind.None;

                default:
                    Debug.Assert(false, "Unexpected TotemOperator: " + op.ToString());
                    return TotemOperationKind.None;
            }
        }