RefreshPropertiesAttribute.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // System.ComponentModel.RefreshPropertiesAttribute.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Andreas Nahr ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2002
  9. // (C) 2003 Andreas Nahr
  10. //
  11. //
  12. namespace System.ComponentModel {
  13. [AttributeUsage (AttributeTargets.All)]
  14. public sealed class RefreshPropertiesAttribute : Attribute {
  15. #region Fields
  16. RefreshProperties refresh;
  17. #endregion // Fields
  18. public static readonly RefreshPropertiesAttribute All = new RefreshPropertiesAttribute (RefreshProperties.All);
  19. public static readonly RefreshPropertiesAttribute Default = new RefreshPropertiesAttribute (RefreshProperties.None);
  20. public static readonly RefreshPropertiesAttribute Repaint = new RefreshPropertiesAttribute (RefreshProperties.Repaint);
  21. #region Constructors
  22. public RefreshPropertiesAttribute (RefreshProperties refresh)
  23. {
  24. this.refresh = refresh;
  25. }
  26. #endregion // Constructors
  27. #region Properties
  28. public RefreshProperties RefreshProperties {
  29. get { return refresh; }
  30. }
  31. #endregion // Properties
  32. #region Methods
  33. public override bool Equals (object obj)
  34. {
  35. if (!(obj is RefreshPropertiesAttribute))
  36. return false;
  37. if (obj == this)
  38. return true;
  39. return ((RefreshPropertiesAttribute) obj).RefreshProperties == refresh;
  40. }
  41. public override int GetHashCode ()
  42. {
  43. return refresh.GetHashCode ();
  44. }
  45. public override bool IsDefaultAttribute ()
  46. {
  47. return (this == RefreshPropertiesAttribute.Default);
  48. }
  49. #endregion // Methods
  50. }
  51. }