Example #1
0
        /// <summary>
        /// Executes an ELSE statement configuration script against the target (StopWatch is passed along to track timout adherence)
        /// </summary>
        protected virtual void DoELSE(Stopwatch sw, ConfigSectionNode elseStatement, ConfigSectionNode priorStatement, ConfigSectionNode target)
        {
            if (priorStatement == null || !priorStatement.IsSameName(DEFAULT_KEYWORD_IF))
            {
                throw new ConfigException(StringConsts.CONFIGURATION_SCRIPT_ELSE_NOT_AFTER_IF_ERROR.Args(elseStatement.RootPath));
            }

            InitStatement(elseStatement);

            var condition = priorStatement.m_Script_Bool_Condition_Result;

            if (condition)
            {
                return;
            }

            DoNode(sw, elseStatement, target);
        }
Example #2
0
        private void doELSE(Stopwatch sw, ConfigSectionNode elseStatement, ConfigSectionNode priorStatement, ConfigSectionNode target)
        {
            if (priorStatement==null || !priorStatement.IsSameName(DEFAULT_KEYWORD_IF))
                                    throw new ConfigException(StringConsts.CONFIGURATION_SCRIPT_ELSE_NOT_AFTER_IF_ERROR.Args(elseStatement.RootPath));

                                initStatement(elseStatement);

                                var condition =  priorStatement.m_Script_Bool_Condition_Result;
                                if (condition) return;

                                doNode(sw, elseStatement, target);
        }