public static TResult CreateElseNode <TResult>(FluentScope fluentScope)
        {
            var tmpScope = fluentScope.CreateChild();

            tmpScope.Set(RegistryKeys.FluentScopeAction, new FluentScopeAction(BuilderHelper.SwitchToElse));
            return(CreateFluentNode <TResult>(tmpScope));
        }
        public static TEndIf CreateEndIf <TEndIf>(FluentScope fluentScope)
        {
            var tmpScope = fluentScope.CreateChild(fluentScope.Get(RegistryKeys.IfScope));

            //TODO: Make all IFluentNodes have a new() constructor and an Initialize(FluentScope2) method
            return(CreateFluentNode <TEndIf>(tmpScope));
        }
        public ForClass <T> EndSetup()
        {
            //TODO: Use the same concept as for the IfScope (see RegistryKeys). And have EndSetup on all setup nodes, or none at all!.
            var parentNode = _fluentScope.Get(RegistryKeys.FluentNodeParent);
            //Create a new child, but get values from the parent for class
            var tmpScope = _fluentScope.CreateChild(parentNode.FluentScope);

            return(new ForClass <T>(tmpScope));
        }
        public static TResult CreateMustPassRule <TRule, TResult>(IRule <TRule> rule, FluentScope fluentScope, bool isCrossField)
        {
            var tmpScope = fluentScope.CreateChild();

            tmpScope.Set(RegistryKeys.FluentScopeAction, new FluentScopeAction(BuilderHelper.RegisterRule));
            tmpScope.Set(RegistryKeys.Rule, rule);
            tmpScope.Set(RegistryKeys.IsCrossField, isCrossField);

            return(CreateFluentNode <TResult>(tmpScope));
        }
        public static ForClassElseEndIf <T, ENDIF> CreateIf <T, ENDIF>(FluentScope fluentScope, LambdaExpression conditionalExpression)
        {
            var tmpScope = fluentScope.CreateChild();

            tmpScope.Set(RegistryKeys.FluentScopeAction, new FluentScopeAction(BuilderHelper.RegisterConditional));
            tmpScope.Set(RegistryKeys.ConditionalExpression, conditionalExpression);
            tmpScope.Set(RegistryKeys.IfScope, fluentScope);

            var result = new ForClassElseEndIf <T, ENDIF>(tmpScope);

            return(result);
        }