Esempio n. 1
0
        public static IFluentContinuation <TViewModel, TPropertyValue> BetweenPoperties <TViewModel, TPropertyValue>(
            this IFluentOperator <TViewModel, TPropertyValue> instance,
            Expression <Func <TViewModel, IViewModelProperty> > @from,
            Expression <Func <TViewModel, IViewModelProperty> > to)
            where TViewModel : ViewModelBase
        {
            var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance;

            implementerInstance.EnsureContextCurrentPropertyIsNotNull();

            implementerInstance.UpdateContext(@from);
            implementerInstance.UpdateContext(to);

            // uses parenthesis to satisfy syntax : IsNot.BetweenValues (...)
            implementerInstance.AddToken(ExpressionNode.OpenParenthesis());
            implementerInstance.AddToken(ExpressionNode.OpenParenthesis());
            implementerInstance.AddToken(ExpressionNode.GreaterThanProperty(implementerInstance.Context.CurrentProperty, @from.Compile()(implementerInstance.ViewModel)));
            implementerInstance.AddToken(ExpressionNode.Or());
            implementerInstance.AddToken(ExpressionNode.EqualToProperty(implementerInstance.Context.CurrentProperty, @from.Compile()(implementerInstance.ViewModel)));
            implementerInstance.AddToken(ExpressionNode.CloseParenthesis());
            implementerInstance.AddToken(ExpressionNode.And());
            implementerInstance.AddToken(ExpressionNode.OpenParenthesis());
            implementerInstance.AddToken(ExpressionNode.LessThanProperty(implementerInstance.Context.CurrentProperty, to.Compile()(implementerInstance.ViewModel)));
            implementerInstance.AddToken(ExpressionNode.Or());
            implementerInstance.AddToken(ExpressionNode.EqualToProperty(implementerInstance.Context.CurrentProperty, to.Compile()(implementerInstance.ViewModel)));
            implementerInstance.AddToken(ExpressionNode.CloseParenthesis());
            implementerInstance.AddToken(ExpressionNode.CloseParenthesis());

            return((IFluentContinuation <TViewModel, TPropertyValue>)instance);
        }
Esempio n. 2
0
        public static IFluentContinuation <TViewModel, TPropertyValue> BetweenValues <TViewModel, TPropertyValue>(
            this IFluentOperator <TViewModel, TPropertyValue> instance,
            object @from,
            object to)
            where TViewModel : ViewModelBase
        {
            var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance;

            implementerInstance.EnsureContextCurrentPropertyIsNotNull();

            // uses parenthesis to satisfy syntax : IsNot.BetweenValues (...)
            implementerInstance.AddToken(ExpressionNode.OpenParenthesis());
            implementerInstance.AddToken(ExpressionNode.OpenParenthesis());
            implementerInstance.AddToken(ExpressionNode.GreaterThanValue(implementerInstance.Context.CurrentProperty, @from));
            implementerInstance.AddToken(ExpressionNode.Or());
            implementerInstance.AddToken(ExpressionNode.EqualToValue(implementerInstance.Context.CurrentProperty, @from));
            implementerInstance.AddToken(ExpressionNode.CloseParenthesis());
            implementerInstance.AddToken(ExpressionNode.And());
            implementerInstance.AddToken(ExpressionNode.OpenParenthesis());
            implementerInstance.AddToken(ExpressionNode.LessThanValue(implementerInstance.Context.CurrentProperty, to));
            implementerInstance.AddToken(ExpressionNode.Or());
            implementerInstance.AddToken(ExpressionNode.EqualToValue(implementerInstance.Context.CurrentProperty, to));
            implementerInstance.AddToken(ExpressionNode.CloseParenthesis());
            implementerInstance.AddToken(ExpressionNode.CloseParenthesis());

            return((IFluentContinuation <TViewModel, TPropertyValue>)instance);
        }