InstallerTypeAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / ComponentModel / InstallerTypeAttribute.cs / 1 / InstallerTypeAttribute.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

/* 
 */ 

// SECREVIEW: Remove this attribute once bug#411889 is fixed. 
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope="member", Target="System.ComponentModel.InstallerTypeAttribute.get_InstallerType():System.Type")]

namespace System.ComponentModel {
    using System.Diagnostics; 
    using System.Security.Permissions;
 
    ///  
    ///    Specifies the installer
    ///       to use for a type to install components. 
    /// 
    [AttributeUsage(AttributeTargets.Class)]
    public class InstallerTypeAttribute : Attribute {
        string _typeName; 

        ///  
        /// Initializes a new instance of the System.Windows.Forms.ComponentModel.InstallerTypeAttribute class. 
        /// 
        public InstallerTypeAttribute(Type installerType) { 
            _typeName = installerType.AssemblyQualifiedName;
        }

        ///  
        ///    [To be supplied.]
        ///  
        public InstallerTypeAttribute(string typeName) { 
            _typeName = typeName;
        } 

        /// 
        ///     Gets the
        ///       type of installer associated with this attribute. 
        /// 
        public virtual Type InstallerType { 
            get { 
                return Type.GetType(_typeName);
            } 
        }

        public override bool Equals(object obj) {
            if (obj == this) { 
                return true;
            } 
 
            InstallerTypeAttribute other = obj as InstallerTypeAttribute;
 
            return (other != null) && other._typeName == _typeName;
        }

        public override int GetHashCode() { 
            return base.GetHashCode();
        } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

/* 
 */ 

// SECREVIEW: Remove this attribute once bug#411889 is fixed. 
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope="member", Target="System.ComponentModel.InstallerTypeAttribute.get_InstallerType():System.Type")]

namespace System.ComponentModel {
    using System.Diagnostics; 
    using System.Security.Permissions;
 
    ///  
    ///    Specifies the installer
    ///       to use for a type to install components. 
    /// 
    [AttributeUsage(AttributeTargets.Class)]
    public class InstallerTypeAttribute : Attribute {
        string _typeName; 

        ///  
        /// Initializes a new instance of the System.Windows.Forms.ComponentModel.InstallerTypeAttribute class. 
        /// 
        public InstallerTypeAttribute(Type installerType) { 
            _typeName = installerType.AssemblyQualifiedName;
        }

        ///  
        ///    [To be supplied.]
        ///  
        public InstallerTypeAttribute(string typeName) { 
            _typeName = typeName;
        } 

        /// 
        ///     Gets the
        ///       type of installer associated with this attribute. 
        /// 
        public virtual Type InstallerType { 
            get { 
                return Type.GetType(_typeName);
            } 
        }

        public override bool Equals(object obj) {
            if (obj == this) { 
                return true;
            } 
 
            InstallerTypeAttribute other = obj as InstallerTypeAttribute;
 
            return (other != null) && other._typeName == _typeName;
        }

        public override int GetHashCode() { 
            return base.GetHashCode();
        } 
    } 
}

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