예제 #1
0
        /// <summary>
        ///     Construct an <see cref="LSLControlStatementNode" /> with 'if', 'else-if' and
        ///     'else' statement nodes.
        /// </summary>
        /// <param name="ifStatement">The if statement that starts the control chain.</param>
        /// <param name="elseIfStatements">Else-if statements.</param>
        /// <param name="elseStatement">The else statement.</param>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="ifStatement" /> or <paramref name="elseIfStatements" /> or
        ///     <paramref name="elseStatement" /> is <c>null</c>.
        /// </exception>
        public LSLControlStatementNode(LSLIfStatementNode ifStatement,
                                       IEnumerable <LSLElseIfStatementNode> elseIfStatements, LSLElseStatementNode elseStatement)
        {
            if (ifStatement == null)
            {
                throw new ArgumentNullException("ifStatement");
            }
            if (elseIfStatements == null)
            {
                throw new ArgumentNullException("elseIfStatements");
            }
            if (elseStatement == null)
            {
                throw new ArgumentNullException("elseStatement");
            }


            IfStatement   = ifStatement;
            ElseStatement = elseStatement;

            foreach (var elif in elseIfStatements)
            {
                AddElseIfStatement(elif);
            }
        }
예제 #2
0
        /// <summary>
        ///     Construct an <see cref="LSLControlStatementNode" /> with 'if' and 'else'
        ///     statement nodes.
        /// </summary>
        /// <param name="ifStatement">The if statement that starts the control chain.</param>
        /// <param name="elseStatement">The else statement.</param>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="ifStatement" /> or <paramref name="elseStatement" /> is
        ///     <c>null</c>.
        /// </exception>
        public LSLControlStatementNode(LSLIfStatementNode ifStatement, LSLElseStatementNode elseStatement)
        {
            if (ifStatement == null)
            {
                throw new ArgumentNullException("ifStatement");
            }
            if (elseStatement == null)
            {
                throw new ArgumentNullException("elseStatement");
            }

            IfStatement   = ifStatement;
            ElseStatement = elseStatement;
        }