CodeConditionStatement.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / CodeDOM / CodeConditionStatement.cs / 1 / CodeConditionStatement.cs

                            //------------------------------------------------------------------------------ 
// 
//     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; 
            } 
        }
    } 
}


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK