2 // ReadOnlyAttribute.cs
5 // Chris J Breisch (cjbreisch@altavista.net)
7 // (C) 2002 Chris J Breisch
9 namespace System.ComponentModel {
10 [AttributeUsage (AttributeTargets.All)]
11 sealed public class ReadOnlyAttribute : Attribute {
14 public static readonly ReadOnlyAttribute No;
15 public static readonly ReadOnlyAttribute Yes;
16 public static readonly ReadOnlyAttribute Default;
18 static ReadOnlyAttribute ()
20 No = new ReadOnlyAttribute (false);
21 Yes = new ReadOnlyAttribute (true);
22 Default = new ReadOnlyAttribute (false);
25 public ReadOnlyAttribute (bool read_only)
27 this.read_only = read_only;
30 public bool IsReadOnly {
36 public override int GetHashCode ()
38 return base.GetHashCode ();
41 public override bool Equals (object o)
43 if (!(o is ReadOnlyAttribute))
46 return (((ReadOnlyAttribute) o).read_only == read_only);
49 public override bool IsDefaultAttribute ()
51 return Equals (Default);