ParenthesizePropertyNameAttribute.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 / ComponentModel / Design / ParenthesizePropertyNameAttribute.cs / 1 / ParenthesizePropertyNameAttribute.cs

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

namespace System.ComponentModel { 
 
    using System;
    using System.Security.Permissions; 

    /// 
    ///    Provides a value indicating whether the name of the associated property is parenthesized in the
    ///       properties window. 
    /// 
    [AttributeUsage(AttributeTargets.All)] 
    public sealed class ParenthesizePropertyNameAttribute : Attribute { 
        /// 
        ///     
        ///       Sets the System.ComponentModel.Design.ParenthesizePropertyName
        ///       attribute by default to
        ///    .
        ///     
        /// 
        public static readonly ParenthesizePropertyNameAttribute Default = new ParenthesizePropertyNameAttribute(); 
 
        private bool needParenthesis;
 
        /// 
        ///    [To be supplied.]
        /// 
        public ParenthesizePropertyNameAttribute() : this(false) { 
        }
 
        ///  
        /// Initializes a new instance of the System.ComponentModel.Design.ParenthesizePropertyNameAttribute
        /// class, using the specified value to indicate whether the attribute is 
        /// marked for display with parentheses.
        /// 
        public ParenthesizePropertyNameAttribute(bool needParenthesis) {
            this.needParenthesis = needParenthesis; 
        }
 
        ///  
        ///    
        ///       Gets a value indicating 
        ///       whether the
        ///       attribute is placed in parentheses when listed in
        ///       the properties window.
        ///     
        /// 
        public bool NeedParenthesis { 
            get { 
                return needParenthesis;
            } 
        }

        /// 
        ///    Compares the specified object 
        ///       to this object and tests for equality.
        ///  
        public override bool Equals(object o) { 
            if (o is ParenthesizePropertyNameAttribute) {
                return ((ParenthesizePropertyNameAttribute)o).NeedParenthesis == needParenthesis; 
            }
            return false;
        }
 
        /// 
        ///     
        ///       Returns the hashcode for this object. 
        ///    
        ///  
        public override int GetHashCode() {
            return base.GetHashCode();
        }
 
        /// 
        /// Gets a value indicating whether this attribute is set to  by default. 
        ///  
        public override bool IsDefaultAttribute() {
            return this.Equals(Default); 
        }
    }
}


                        

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