| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // System.ComponentModel.ParenthesizePropertyNameAttribute
- //
- // Authors:
- // Martin Willemoes Hansen ([email protected])
- // Andreas Nahr ([email protected])
- //
- // (C) 2003 Martin Willemoes Hansen
- // (C) 2003 Andreas Nahr
- //
- namespace System.ComponentModel
- {
- [AttributeUsage(AttributeTargets.All)]
- public sealed class ParenthesizePropertyNameAttribute : Attribute
- {
- private bool parenthesis;
- public static readonly ParenthesizePropertyNameAttribute Default = new ParenthesizePropertyNameAttribute();
- public ParenthesizePropertyNameAttribute()
- {
- this.parenthesis = false;
- }
- public ParenthesizePropertyNameAttribute (bool needParenthesis)
- {
- this.parenthesis = needParenthesis;
- }
- public bool NeedParenthesis {
- get { return parenthesis; }
- }
- public override bool Equals (object o)
- {
- if (!(o is ParenthesizePropertyNameAttribute))
- return false;
- if (o == this)
- return true;
- return ((ParenthesizePropertyNameAttribute) o).NeedParenthesis == parenthesis;
- }
- public override int GetHashCode()
- {
- return parenthesis.GetHashCode ();
- }
- public override bool IsDefaultAttribute()
- {
- return parenthesis == ParenthesizePropertyNameAttribute.Default.NeedParenthesis;
- }
- }
- }
|