public override IOperation GetOperation(LambdaExpression expr)
        {
            var methodCall = expr.Body as MethodCallExpression;

            var startFieldRef = operandBuilder.CreateFieldRefOperand(methodCall.Arguments[0], null);
            var stopFieldRef = operandBuilder.CreateFieldRefOperand(methodCall.Arguments[1], null);
            var recurrenceFieldRef = operandBuilder.CreateFieldRefOperand(methodCall.Arguments[2], null);

            IOperand dateTimeValue;
            if (!isValidRightExpressionWithStringBasedSyntax(methodCall.Arguments[3]))
            {
                dateTimeValue = operandBuilder.CreateValueOperandForNativeSyntax(methodCall.Arguments[3]);
            }
            else
            {
                dateTimeValue = operandBuilder.CreateValueOperandForStringBasedSyntax(methodCall.Arguments[3]);
            }

            var operation = new DateRangesOverlapOperation(
                operationResultBuilder, startFieldRef, stopFieldRef, recurrenceFieldRef, dateTimeValue);

            return operation;
        }
示例#2
0
        public override IOperation GetOperation(LambdaExpression expr)
        {
            var methodCall = expr.Body as MethodCallExpression;

            var startFieldRef      = operandBuilder.CreateFieldRefOperand(methodCall.Arguments[0], null);
            var stopFieldRef       = operandBuilder.CreateFieldRefOperand(methodCall.Arguments[1], null);
            var recurrenceFieldRef = operandBuilder.CreateFieldRefOperand(methodCall.Arguments[2], null);

            IOperand dateTimeValue;

            if (!isValidRightExpressionWithStringBasedSyntax(methodCall.Arguments[3]))
            {
                dateTimeValue = operandBuilder.CreateValueOperandForNativeSyntax(methodCall.Arguments[3]);
            }
            else
            {
                dateTimeValue = operandBuilder.CreateValueOperandForStringBasedSyntax(methodCall.Arguments[3]);
            }

            var operation = new DateRangesOverlapOperation(
                operationResultBuilder, startFieldRef, stopFieldRef, recurrenceFieldRef, dateTimeValue);

            return(operation);
        }