ReadOnlyAttribute.cs 740 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // ReadOnlyAttribute.cs
  3. //
  4. // Author:
  5. // Chris J Breisch ([email protected])
  6. //
  7. // (C) 2002 Chris J Breisch
  8. //
  9. namespace System.ComponentModel {
  10. [AttributeUsage (AttributeTargets.All)]
  11. sealed public class ReadOnlyAttribute : Attribute {
  12. bool read_only;
  13. public static readonly ReadOnlyAttribute No;
  14. public static readonly ReadOnlyAttribute Yes;
  15. public static readonly ReadOnlyAttribute Default;
  16. static ReadOnlyAttribute ()
  17. {
  18. No = new ReadOnlyAttribute (false);
  19. Yes = new ReadOnlyAttribute (false);
  20. Default = new ReadOnlyAttribute (false);
  21. }
  22. public ReadOnlyAttribute (bool read_only)
  23. {
  24. this.read_only = read_only;
  25. }
  26. public bool IsReadOnly {
  27. get {
  28. return read_only;
  29. }
  30. }
  31. };
  32. }