DescriptionAttribute.cs 743 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // System.ComponentModel.DescriptionAttribute.cs
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. //
  10. namespace System.ComponentModel {
  11. [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
  12. public class DescriptionAttribute : Attribute {
  13. string desc;
  14. public DescriptionAttribute (string name)
  15. {
  16. desc = name;
  17. }
  18. public DescriptionAttribute ()
  19. {
  20. desc = "";
  21. }
  22. public virtual string Description {
  23. get {
  24. return DescriptionValue;
  25. }
  26. }
  27. //
  28. // Notice that the default Description implementation uses this by default
  29. //
  30. protected string DescriptionValue {
  31. get {
  32. return desc;
  33. }
  34. set {
  35. desc = value;
  36. }
  37. }
  38. }
  39. }