ItemCheckEventArgs.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. //
  2. // System.Windows.Forms.ItemCheckEventArgs.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. namespace System.Windows.Forms {
  12. // <summary>
  13. // This is only a template. Nothing is implemented yet.
  14. //
  15. // </summary>
  16. public class ItemCheckEventArgs : EventArgs {
  17. #region Fields
  18. private int index;
  19. private CheckState newcheckvalue;
  20. private CheckState currentcheckvalue;
  21. #endregion
  22. //
  23. // --- Constructor
  24. //
  25. public ItemCheckEventArgs(int index, CheckState newCheckValue, CheckState currentValue )
  26. {
  27. this.index = index;
  28. newcheckvalue = newCheckValue;
  29. currentcheckvalue = currentValue;
  30. }
  31. #region Public Properties
  32. public CheckState CurrentValue
  33. {
  34. get {
  35. return currentcheckvalue;
  36. }
  37. }
  38. public int Index {
  39. get {
  40. return index;
  41. }
  42. }
  43. public CheckState NewValue {
  44. get {
  45. return newcheckvalue;
  46. }
  47. set {
  48. newcheckvalue = value;
  49. }
  50. }
  51. #endregion
  52. #region Public Methods
  53. /// <summary>
  54. /// Equality Operator
  55. /// </summary>
  56. ///
  57. /// <remarks>
  58. /// Compares two ItemCheckEventArgs objects.
  59. /// The return value is based on the equivalence of
  60. /// CurrentValue, Index, NewValue and end Property
  61. /// of the two ItemCheckEventArgs.
  62. /// </remarks>
  63. public static bool operator == (ItemCheckEventArgs ItemCheckEventArgsA, ItemCheckEventArgs ItemCheckEventArgsB)
  64. {
  65. return (ItemCheckEventArgsA.CurrentValue == ItemCheckEventArgsB.CurrentValue) &&
  66. (ItemCheckEventArgsA.Index == ItemCheckEventArgsB.Index) &&
  67. (ItemCheckEventArgsA.NewValue == ItemCheckEventArgsB.NewValue);
  68. }
  69. /// <summary>
  70. /// Inequality Operator
  71. /// </summary>
  72. ///
  73. /// <remarks>
  74. /// Compares two ItemCheckEventArgs objects.
  75. /// The return value is based on the equivalence of
  76. /// CurrentValue, Index, NewValue and end Property
  77. /// of the two ItemCheckEventArgs.
  78. /// </remarks>
  79. public static bool operator != (ItemCheckEventArgs ItemCheckEventArgsA, ItemCheckEventArgs ItemCheckEventArgsB)
  80. {
  81. return (ItemCheckEventArgsA.CurrentValue != ItemCheckEventArgsB.CurrentValue) ||
  82. (ItemCheckEventArgsA.Index != ItemCheckEventArgsB.Index) ||
  83. (ItemCheckEventArgsA.NewValue != ItemCheckEventArgsB.NewValue);
  84. }
  85. /// <summary>
  86. /// Equals Method
  87. /// </summary>
  88. ///
  89. /// <remarks>
  90. /// Checks equivalence of this
  91. /// ItemCheckEventArgs and another
  92. /// object.
  93. /// </remarks>
  94. public override bool Equals (object obj)
  95. {
  96. if (!(obj is ItemCheckEventArgs))return false;
  97. return (this == (ItemCheckEventArgs) obj);
  98. }
  99. /// <summary>
  100. /// GetHashCode Method
  101. /// </summary>
  102. ///
  103. /// <remarks>
  104. /// Calculates a hashing value.
  105. /// </remarks>
  106. [MonoTODO]
  107. public override int GetHashCode ()
  108. {
  109. //FIXME: add class specific stuff;
  110. return base.GetHashCode();
  111. }
  112. /// <summary>
  113. /// ToString Method
  114. /// </summary>
  115. ///
  116. /// <remarks>
  117. /// Formats the object as a string.
  118. /// </remarks>
  119. [MonoTODO]
  120. public override string ToString ()
  121. {
  122. //FIXME: add class specific stuff;
  123. return base.ToString() + " ItemCheckEventArgs";
  124. }
  125. #endregion
  126. }
  127. }