1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 namespace System.CodeDom
6 {
7     [Serializable]
8     public class CodeConditionStatement : CodeStatement
9     {
CodeConditionStatement()10         public CodeConditionStatement() { }
11 
CodeConditionStatement(CodeExpression condition, params CodeStatement[] trueStatements)12         public CodeConditionStatement(CodeExpression condition, params CodeStatement[] trueStatements)
13         {
14             Condition = condition;
15             TrueStatements.AddRange(trueStatements);
16         }
17 
CodeConditionStatement(CodeExpression condition, CodeStatement[] trueStatements, CodeStatement[] falseStatements)18         public CodeConditionStatement(CodeExpression condition, CodeStatement[] trueStatements, CodeStatement[] falseStatements)
19         {
20             Condition = condition;
21             TrueStatements.AddRange(trueStatements);
22             FalseStatements.AddRange(falseStatements);
23         }
24 
25         public CodeExpression Condition { get; set; }
26 
27         public CodeStatementCollection TrueStatements { get; } = new CodeStatementCollection();
28 
29         public CodeStatementCollection FalseStatements { get; } = new CodeStatementCollection();
30     }
31 }
32