TreeViewCancelEventArgs.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //
  2. // System.Windows.Forms.TreeViewCancelEventArgs
  3. //
  4. // Author:
  5. // stubbed out by Jackson Harper ([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.ComponentModel;
  12. namespace System.Windows.Forms {
  13. // <summary>
  14. // </summary>
  15. public class TreeViewCancelEventArgs : CancelEventArgs {
  16. private TreeNode node;
  17. private TreeViewAction action;
  18. //
  19. // --- Public Constructors
  20. //
  21. public TreeViewCancelEventArgs(TreeNode node, bool cancel, TreeViewAction action) : base(cancel)
  22. {
  23. this.node = node;
  24. this.action = action;
  25. }
  26. #region Public Properties
  27. /// <summary>
  28. /// Action Property
  29. /// </summary>
  30. ///
  31. /// <remarks>
  32. /// Gets the type of TreeViewAction that raised the event.
  33. /// </remarks>
  34. public TreeViewAction Action
  35. {
  36. get {
  37. return action;
  38. }
  39. }
  40. /// <summary>
  41. /// Node Property
  42. /// </summary>
  43. ///
  44. /// <remarks>
  45. /// Gets the tree node to be checked, expanded, collapsed, or selected.
  46. /// </remarks>
  47. public TreeNode Node
  48. {
  49. get {
  50. return node;
  51. }
  52. }
  53. #endregion
  54. #region Public Methods
  55. /// <summary>
  56. /// Equals Method
  57. /// </summary>
  58. ///
  59. /// <remarks>
  60. /// Checks equivalence of this TreeViewCancelEventArgs and another object.
  61. /// </remarks>
  62. public override bool Equals(object obj)
  63. {
  64. if (!(obj is TreeViewCancelEventArgs))
  65. return false;
  66. return (this == (TreeViewCancelEventArgs) obj);
  67. }
  68. /// <summary>
  69. /// Equality Operator
  70. /// </summary>
  71. ///
  72. /// <remarks>
  73. /// Compares two TreeViewCancelEventArgs objects. The return value is
  74. /// based on the equivalence of the node and action property
  75. /// of the two TreeViewCancelEventArgs.
  76. /// </remarks>
  77. public static bool operator == (TreeViewCancelEventArgs TreeViewCancelEventArgsA, TreeViewCancelEventArgs TreeViewCancelEventArgsB)
  78. {
  79. return ((TreeViewCancelEventArgsA.action == TreeViewCancelEventArgsB.action) && (TreeViewCancelEventArgsA.Node == TreeViewCancelEventArgsB.Node)) ;
  80. }
  81. /// <summary>
  82. /// Inequality Operator
  83. /// </summary>
  84. ///
  85. /// <remarks>
  86. /// Compares two TreeViewCancelEventArgs objects. The return value is
  87. /// based on the equivalence of the node and action property
  88. /// of the two TreeViewCancelEventArgs.
  89. /// </remarks>
  90. public static bool operator != (TreeViewCancelEventArgs TreeViewCancelEventArgsA, TreeViewCancelEventArgs TreeViewCancelEventArgsB)
  91. {
  92. return ((TreeViewCancelEventArgsA.action != TreeViewCancelEventArgsB.action) || (TreeViewCancelEventArgsA.Node != TreeViewCancelEventArgsB.Node)) ;
  93. }
  94. /// <summary>
  95. /// GetHashCode Method
  96. /// </summary>
  97. ///
  98. /// <remarks>
  99. /// Calculates a hashing value.
  100. /// </remarks>
  101. [MonoTODO]
  102. public override int GetHashCode ()
  103. {
  104. //FIXME: add class specific stuff;
  105. return base.GetHashCode();
  106. }
  107. /// <summary>
  108. /// ToString Method
  109. /// </summary>
  110. ///
  111. /// <remarks>
  112. /// Formats the TreeViewCancelEventArgs as a string.
  113. /// </remarks>
  114. [MonoTODO]
  115. public override string ToString ()
  116. {
  117. //FIXME: add class specific stuff;
  118. return base.ToString();
  119. }
  120. #endregion // Public Methods
  121. }
  122. }