ControlEventArgs.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. //
  2. // System.Windows.Forms.ControlEventArgs.cs
  3. //
  4. // Author:
  5. // stubbed out by Jaak Simm ([email protected])
  6. // implemented for Gtk+ by Rachel Hestilow ([email protected])
  7. // Dennis Hayes ([email protected])
  8. // Gianandrea Terzi ([email protected])
  9. // (C) Ximian, Inc., 2002
  10. namespace System.Windows.Forms {
  11. /// <summary>
  12. /// Complete.
  13. /// </summary>
  14. public class ControlEventArgs : EventArgs {
  15. #region Fields
  16. Control control;
  17. #endregion
  18. public ControlEventArgs(Control control)
  19. {
  20. this.control = control;
  21. }
  22. #region Public Properties
  23. public Control Control
  24. {
  25. get
  26. {
  27. return control;
  28. }
  29. }
  30. #endregion
  31. #region Public Methods
  32. /// <summary>
  33. /// Equality Operator
  34. /// </summary>
  35. ///
  36. /// <remarks>
  37. /// Compares two ControlEventArgs objects.
  38. /// The return value is based on the equivalence of
  39. /// control Property
  40. /// of the two ControlEventArgs.
  41. /// </remarks>
  42. public static bool operator == (ControlEventArgs ControlEventArgsA, ControlEventArgs ControlEventArgsB)
  43. {
  44. return (ControlEventArgsA.Control == ControlEventArgsB.Control);
  45. }
  46. /// <summary>
  47. /// Inequality Operator
  48. /// </summary>
  49. ///
  50. /// <remarks>
  51. /// Compares two ControlEventArgs objects.
  52. /// The return value is based on the equivalence of
  53. /// control Property
  54. /// of the two ControlEventArgs.
  55. /// </remarks>
  56. public static bool operator != (ControlEventArgs ControlEventArgsA, ControlEventArgs ControlEventArgsB)
  57. {
  58. return (ControlEventArgsA.Control != ControlEventArgsB.Control);
  59. }
  60. /// <summary>
  61. /// Equals Method
  62. /// </summary>
  63. ///
  64. /// <remarks>
  65. /// Checks equivalence of this
  66. /// ControlEventArgs and another
  67. /// object.
  68. /// </remarks>
  69. public override bool Equals (object obj)
  70. {
  71. if (!(obj is ControlEventArgs))return false;
  72. return (this == (ControlEventArgs) obj);
  73. }
  74. /// <summary>
  75. /// GetHashCode Method
  76. /// </summary>
  77. ///
  78. /// <remarks>
  79. /// Calculates a hashing value.
  80. /// </remarks>
  81. [MonoTODO]
  82. public override int GetHashCode ()
  83. {
  84. //FIXME: add class specific stuff;
  85. return base.GetHashCode();
  86. }
  87. /// <summary>
  88. /// ToString Method
  89. /// </summary>
  90. ///
  91. /// <remarks>
  92. /// Formats the object as a string.
  93. /// </remarks>
  94. [MonoTODO]
  95. public override string ToString ()
  96. {
  97. //FIXME: add class specific stuff;
  98. return base.ToString() + " ControlEventArgs";
  99. }
  100. #endregion
  101. }
  102. }