Example #1
0
        protected override Expression VisitConditional(ConditionalExpression c)
        {
            var parametersTest    = new ParameterListBuilder(parameterMap, modelParameters, variationType).GetParameters(c.Test);
            var parametersIfTrue  = new ParameterListBuilder(parameterMap, modelParameters, variationType).GetParameters(c.IfTrue);
            var parametersIfFalse = new ParameterListBuilder(parameterMap, modelParameters, variationType).GetParameters(c.IfFalse);

            MergeParameterLists(parametersTest);
            MergeParameterLists(parametersIfTrue);
            MergeParameterLists(parametersIfFalse);
            return(c);
        }
Example #2
0
        protected override Expression VisitBinary(BinaryExpression b)
        {
            if (b.NodeType == ExpressionType.AndAlso || b.NodeType == ExpressionType.OrElse)
            {
                var parametersLeft  = new ParameterListBuilder(parameterMap, modelParameters, variationType).GetParameters(b.Left);
                var parametersRight = new ParameterListBuilder(parameterMap, modelParameters, variationType).GetParameters(b.Right);

                MergeParameterLists(parametersLeft);
                MergeParameterLists(parametersRight);
                return(b);
            }
            else
            {
                return(base.VisitBinary(b));
            }
        }
Example #3
0
        internal override ParameterInteraction GetExcludedCombinations(Model <T> model)
        {
            if (CachedInteraction != null)
            {
                return(new ParameterInteraction(CachedInteraction));
            }

            parameters = new ParameterListBuilder(mapExpressionsToRequiredParams, model.Parameters, typeof(T)).GetParameters(Condition);

            CachedInteraction = CreateInteraction(model, Condition, parameters, Condition.Parameters[0]);

            foreach (var item in mapExpressionsToRequiredParams)
            {
                if (item.Key == Condition)
                {
                    mapExpressionsToRequiredParams[item.Key].Interaction = CachedInteraction;
                    continue;
                }

                mapExpressionsToRequiredParams[item.Key].Interaction = CreateInteraction(model, item.Key, item.Value.Parameters, Condition.Parameters[0]);
            }

            return(CachedInteraction);
        }