//------------------------------------------------------------------------------ // // // Microsoft // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ namespace System.CodeDom { using System.Diagnostics; using System; using Microsoft.Win32; using System.Collections; using System.Runtime.InteropServices; /// /// /// Represents a basic if statement. /// /// [ ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable, ] public class CodeConditionStatement : CodeStatement { private CodeExpression condition; private CodeStatementCollection trueStatments = new CodeStatementCollection(); private CodeStatementCollection falseStatments = new CodeStatementCollection(); /// /// /// Initializes a new instance of . /// /// public CodeConditionStatement() { } /// /// /// Initializes a new instance of . /// /// public CodeConditionStatement(CodeExpression condition, params CodeStatement[] trueStatements) { Condition = condition; TrueStatements.AddRange(trueStatements); } /// /// /// Initializes a new instance of that can represent an if.. /// else statement. /// /// public CodeConditionStatement(CodeExpression condition, CodeStatement[] trueStatements, CodeStatement[] falseStatements) { Condition = condition; TrueStatements.AddRange(trueStatements); FalseStatements.AddRange(falseStatements); } /// /// /// Gets or sets /// the condition to test for . /// /// public CodeExpression Condition { get { return condition; } set { condition = value; } } /// /// /// Gets or sets /// the statements to execute if test condition is . /// /// public CodeStatementCollection TrueStatements { get { return trueStatments; } } /// /// /// Gets or sets /// the statements to /// execute if test condition is and there is an else /// clause. /// /// public CodeStatementCollection FalseStatements { get { return falseStatments; } } } }