CodeConditionStatement.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / CodeDOM / CodeConditionStatement.cs / 1305376 / 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;
            } 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//
// [....]
//     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;
            } 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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