2 // System.Windows.Forms.StatusBarDrawItemEventArgs
5 // stubbed out by Richard Baumann (biochem333@nyc.rr.com)
6 // Partially completed by Dennis Hayes (dennish@raytek.com)
8 // (C) Ximian, Inc., 2002
11 namespace System
.Windows
.Forms
{
14 /// Provides data for the DrawItem event.
16 public class StatusBarDrawItemEventArgs
: DrawItemEventArgs
{
18 private StatusBarPanel panel
;
20 /// --- Constructor ---
21 public StatusBarDrawItemEventArgs(Graphics g
, Font font
,
22 Rectangle r
, int itemId
, DrawItemState itemState
,
23 StatusBarPanel panel
, Color foreColor
, Color backColor
)
24 : base(g
, font
, r
, itemId
, itemState
, foreColor
, backColor
) {
28 public StatusBarDrawItemEventArgs(Graphics g
, Font font
,
29 Rectangle r
, int itemId
, DrawItemState itemState
, StatusBarPanel panel
)
30 : base(g
, font
, r
, itemId
, itemState
) {
34 #region Public Properties
35 public StatusBarPanel Panel
43 #region Public Methods
49 /// Compares two StatusBarDrawItemEventArgs objects.
50 /// The return value is based on the equivalence of
51 /// the BackColor, Bounds, Font, ForeColor, Graphics,
52 /// Index, Panel, and State properties of the two
53 /// StatusBarDrawItemEventArgs.
55 public static bool operator == (StatusBarDrawItemEventArgs objA
, StatusBarDrawItemEventArgs objB
)
57 return ((objA
.panel
== objB
.panel
) && ((DrawItemEventArgs
) objA
== (DrawItemEventArgs
) objB
));
61 /// Inequality Operator
65 /// Compares two StatusBarDrawItemEventArgs objects.
66 /// The return value is based on the equivalence of
67 /// the BackColor, Bounds, Font, ForeColor, Graphics,
68 /// Index, Panel, and State properties of the two
69 /// StatusBarDrawItemEventArgs.
71 public static bool operator != (StatusBarDrawItemEventArgs objA
, StatusBarDrawItemEventArgs objB
)
73 return ((objA
.panel
!= objB
.panel
) || ((DrawItemEventArgs
) objA
!= (DrawItemEventArgs
) objB
));
81 /// Checks equivalence of this
82 /// StatusBarDrawItemEventArgs and another object.
84 public override bool Equals (object obj
)
86 if (!(obj
is StatusBarDrawItemEventArgs
))return false;
87 return (this == (StatusBarDrawItemEventArgs
) obj
);
91 /// GetHashCode Method
95 /// Calculates a hashing value.
96 /// Returns DrawItemEventArgs.GetHashCode().
98 public override int GetHashCode ()
100 // FIXME: In a perfect world, get hashcode would include
101 // Panel, but this shouldbe good enough.
102 return base.GetHashCode();
110 /// Formats the StatusBarDrawItemEventArgs as a string.
112 public override string ToString ()
114 return base.ToString() + panel
.ToString();