示例#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 an 'if' statement
        ///     node.
        /// </summary>
        /// <param name="ifStatement">The if statement that starts the control chain.</param>
        /// <exception cref="ArgumentNullException"><paramref name="ifStatement" /> is <c>null</c>.</exception>
        public LSLControlStatementNode(LSLIfStatementNode ifStatement)
        {
            if (ifStatement == null)
            {
                throw new ArgumentNullException("ifStatement");
            }

            IfStatement = ifStatement;
        }