HelpEventArgs.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. //
  2. // System.Windows.Forms.HelpEventArgs.cs
  3. //
  4. // Author:
  5. // stubbed out by Daniel Carrera ([email protected])
  6. // Partially completed by Dennis Hayes ([email protected])
  7. // Gianandrea Terzi ([email protected])
  8. //
  9. // (C) 2002 Ximian, Inc
  10. //
  11. using System.Drawing;
  12. namespace System.Windows.Forms {
  13. // <summary>
  14. // Complete.
  15. // </summary>
  16. public class HelpEventArgs : EventArgs {
  17. #region Fields
  18. private Point mousePos;
  19. private bool handled;
  20. #endregion
  21. //
  22. // --- Constructor
  23. //
  24. public HelpEventArgs(Point mousePos)
  25. {
  26. this.mousePos = mousePos;
  27. handled = false; // Gian : hadled is false, otherwise all events are managed by user by default.
  28. }
  29. #region Public Properties
  30. public bool Handled
  31. {
  32. get {
  33. return handled;
  34. }
  35. set {
  36. handled = value;
  37. }
  38. }
  39. public Point MousePos {
  40. get {
  41. return mousePos;
  42. }
  43. }
  44. #endregion
  45. #region Public Methods
  46. /// <summary>
  47. /// Equality Operator
  48. /// </summary>
  49. ///
  50. /// <remarks>
  51. /// Compares two HelpEventArgs objects.
  52. /// The return value is based on the equivalence of
  53. /// Handled and MousePos Property
  54. /// of the two HelpEventArgs.
  55. /// </remarks>
  56. public static bool operator == (HelpEventArgs HelpEventArgsA, HelpEventArgs HelpEventArgsB)
  57. {
  58. return (HelpEventArgsA.Handled == HelpEventArgsB.Handled) &&
  59. (HelpEventArgsA.MousePos == HelpEventArgsB.MousePos);
  60. }
  61. /// <summary>
  62. /// Inequality Operator
  63. /// </summary>
  64. ///
  65. /// <remarks>
  66. /// Compares two HelpEventArgs objects.
  67. /// The return value is based on the equivalence of
  68. /// Handled and MousePos Property
  69. /// of the two HelpEventArgs.
  70. /// </remarks>
  71. public static bool operator != (HelpEventArgs HelpEventArgsA, HelpEventArgs HelpEventArgsB)
  72. {
  73. return (HelpEventArgsA.Handled != HelpEventArgsB.Handled) ||
  74. (HelpEventArgsA.MousePos != HelpEventArgsB.MousePos);
  75. }
  76. /// <summary>
  77. /// Equals Method
  78. /// </summary>
  79. ///
  80. /// <remarks>
  81. /// Checks equivalence of this
  82. /// HelpEventArgs and another
  83. /// object.
  84. /// </remarks>
  85. public override bool Equals (object obj)
  86. {
  87. if (!(obj is HelpEventArgs))return false;
  88. return (this == (HelpEventArgs) obj);
  89. }
  90. /// <summary>
  91. /// GetHashCode Method
  92. /// </summary>
  93. ///
  94. /// <remarks>
  95. /// Calculates a hashing value.
  96. /// </remarks>
  97. [MonoTODO]
  98. public override int GetHashCode ()
  99. {
  100. //FIXME: add class specific stuff;
  101. return base.GetHashCode();
  102. }
  103. /// <summary>
  104. /// ToString Method
  105. /// </summary>
  106. ///
  107. /// <remarks>
  108. /// Formats the object as a string.
  109. /// </remarks>
  110. [MonoTODO]
  111. public override string ToString ()
  112. {
  113. //FIXME: add class specific stuff;
  114. return base.ToString() + " HelpEventArgs";
  115. }
  116. #endregion
  117. }
  118. }