DefaultPropertyAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / DefaultPropertyAttribute.cs / 1 / DefaultPropertyAttribute.cs

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

/* 
 */ 
namespace System.ComponentModel {
    using System; 
    using System.Diagnostics;
    using System.Security.Permissions;

    ///  
    ///    Specifies the default property for a component.
    ///  
    [AttributeUsage(AttributeTargets.Class)] 
    public sealed class DefaultPropertyAttribute : Attribute {
        ///  
        ///     This is the default event name.
        /// 
        private readonly string name;
 
        /// 
        ///     
        ///       Initializes a new instance of 
        ///       the  class.
        ///     
        /// 
        public DefaultPropertyAttribute(string name) {
            this.name = name;
        } 

        ///  
        ///     
        ///       Gets the name of the default property for the component this attribute is
        ///       bound to. 
        ///    
        /// 
        public string Name {
            get { 
                return name;
            } 
        } 

        ///  
        ///    
        ///       Specifies the default value for the , which is . This
        ///    field is read-only.
        ///     
        /// 
        public static readonly DefaultPropertyAttribute Default = new DefaultPropertyAttribute(null); 
 
        public override bool Equals(object obj) {
            DefaultPropertyAttribute other = obj as DefaultPropertyAttribute; 
            return (other != null) && other.Name == name;
        }

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

/* 
 */ 
namespace System.ComponentModel {
    using System; 
    using System.Diagnostics;
    using System.Security.Permissions;

    ///  
    ///    Specifies the default property for a component.
    ///  
    [AttributeUsage(AttributeTargets.Class)] 
    public sealed class DefaultPropertyAttribute : Attribute {
        ///  
        ///     This is the default event name.
        /// 
        private readonly string name;
 
        /// 
        ///     
        ///       Initializes a new instance of 
        ///       the  class.
        ///     
        /// 
        public DefaultPropertyAttribute(string name) {
            this.name = name;
        } 

        ///  
        ///     
        ///       Gets the name of the default property for the component this attribute is
        ///       bound to. 
        ///    
        /// 
        public string Name {
            get { 
                return name;
            } 
        } 

        ///  
        ///    
        ///       Specifies the default value for the , which is . This
        ///    field is read-only.
        ///     
        /// 
        public static readonly DefaultPropertyAttribute Default = new DefaultPropertyAttribute(null); 
 
        public override bool Equals(object obj) {
            DefaultPropertyAttribute other = obj as DefaultPropertyAttribute; 
            return (other != null) && other.Name == name;
        }

        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