CodeCastExpression.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 / CodeCastExpression.cs / 1305376 / CodeCastExpression.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 
    ///       type cast expression.
    ///    
    /// 
    [ 
        ClassInterface(ClassInterfaceType.AutoDispatch),
        ComVisible(true), 
        Serializable, 
    ]
    public class CodeCastExpression : CodeExpression { 
        private CodeTypeReference targetType;
        private CodeExpression expression;

        ///  
        ///    
        ///       Initializes a new instance of . 
        ///     
        /// 
        public CodeCastExpression() { 
        }

        /// 
        ///     
        ///       Initializes a new instance of  using the specified
        ///       parameters. 
        ///     
        /// 
        public CodeCastExpression(CodeTypeReference targetType, CodeExpression expression) { 
            TargetType = targetType;
            Expression = expression;
        }
 
        /// 
        ///    [To be supplied.] 
        ///  
        public CodeCastExpression(string targetType, CodeExpression expression) {
            TargetType = new CodeTypeReference(targetType); 
            Expression = expression;
        }

        ///  
        ///    [To be supplied.]
        ///  
        public CodeCastExpression(Type targetType, CodeExpression expression) { 
            TargetType = new CodeTypeReference(targetType);
            Expression = expression; 
        }

        /// 
        ///     
        ///       The target type of the cast.
        ///     
        ///  
        public CodeTypeReference TargetType {
            get { 
                if (targetType == null) {
                    targetType = new CodeTypeReference("");
                }
                return targetType; 
            }
            set { 
                targetType = value; 
            }
        } 

        /// 
        ///    
        ///       The expression to cast. 
        ///    
        ///  
        public CodeExpression Expression { 
            get {
                return expression; 
            }
            set {
                expression = value;
            } 
        }
    } 
} 

// 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 
    ///       type cast expression.
    ///    
    /// 
    [ 
        ClassInterface(ClassInterfaceType.AutoDispatch),
        ComVisible(true), 
        Serializable, 
    ]
    public class CodeCastExpression : CodeExpression { 
        private CodeTypeReference targetType;
        private CodeExpression expression;

        ///  
        ///    
        ///       Initializes a new instance of . 
        ///     
        /// 
        public CodeCastExpression() { 
        }

        /// 
        ///     
        ///       Initializes a new instance of  using the specified
        ///       parameters. 
        ///     
        /// 
        public CodeCastExpression(CodeTypeReference targetType, CodeExpression expression) { 
            TargetType = targetType;
            Expression = expression;
        }
 
        /// 
        ///    [To be supplied.] 
        ///  
        public CodeCastExpression(string targetType, CodeExpression expression) {
            TargetType = new CodeTypeReference(targetType); 
            Expression = expression;
        }

        ///  
        ///    [To be supplied.]
        ///  
        public CodeCastExpression(Type targetType, CodeExpression expression) { 
            TargetType = new CodeTypeReference(targetType);
            Expression = expression; 
        }

        /// 
        ///     
        ///       The target type of the cast.
        ///     
        ///  
        public CodeTypeReference TargetType {
            get { 
                if (targetType == null) {
                    targetType = new CodeTypeReference("");
                }
                return targetType; 
            }
            set { 
                targetType = value; 
            }
        } 

        /// 
        ///    
        ///       The expression to cast. 
        ///    
        ///  
        public CodeExpression Expression { 
            get {
                return expression; 
            }
            set {
                expression = value;
            } 
        }
    } 
} 

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