mscorlib(4.0.0.0) API with additions
BrowsableAttribute.cs
1 namespace System.ComponentModel
2 {
4  [AttributeUsage(AttributeTargets.All)]
5  public sealed class BrowsableAttribute : Attribute
6  {
8  public static readonly BrowsableAttribute Yes = new BrowsableAttribute(browsable: true);
9 
11  public static readonly BrowsableAttribute No = new BrowsableAttribute(browsable: false);
12 
14  public static readonly BrowsableAttribute Default = Yes;
15 
16  private bool browsable = true;
17 
21  public bool Browsable => browsable;
22 
26  public BrowsableAttribute(bool browsable)
27  {
28  this.browsable = browsable;
29  }
30 
35  public override bool Equals(object obj)
36  {
37  if (obj == this)
38  {
39  return true;
40  }
41  BrowsableAttribute browsableAttribute = obj as BrowsableAttribute;
42  if (browsableAttribute != null)
43  {
44  return browsableAttribute.Browsable == browsable;
45  }
46  return false;
47  }
48 
51  public override int GetHashCode()
52  {
53  return browsable.GetHashCode();
54  }
55 
59  public override bool IsDefaultAttribute()
60  {
61  return Equals(Default);
62  }
63  }
64 }
Specifies whether a property or event should be displayed in a Properties window.
override bool Equals(object obj)
Indicates whether this instance and a specified object are equal.
Represents the base class for custom attributes.
Definition: Attribute.cs:15
static readonly BrowsableAttribute Yes
Specifies that a property or event can be modified at design time. This static field is read-only.
override bool IsDefaultAttribute()
Determines if this attribute is the default.
bool Browsable
Gets a value indicating whether an object is browsable.
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
BrowsableAttribute(bool browsable)
Initializes a new instance of the T:System.ComponentModel.BrowsableAttribute class.
static readonly BrowsableAttribute Default
Specifies the default value for the T:System.ComponentModel.BrowsableAttribute, which is F:System....
static readonly BrowsableAttribute No
Specifies that a property or event cannot be modified at design time. This static field is read-only.
override int GetHashCode()
Returns the hash code for this instance.