2 // System.Windows.Forms.MeasureItemEventArgs.cs
5 // stubbed out by Paul Osman (paul.osman@sympatico.ca)
6 // Partially completed by Dennis Hayes (dennish@raytek.com)
7 // Gianandrea Terzi (gianandrea.terzi@lario.com)
9 // (C) 2002 Ximian, Inc
13 using System
.Reflection
;
14 using System
.Globalization
;
15 //using System.Windows.Forms.AccessibleObject.IAccessible;
18 namespace System
.Windows
.Forms
{
24 public class MeasureItemEventArgs
: EventArgs
{
28 private Graphics graphics
;
30 private int itemheight
= -1;
31 private int itemwidth
= -1;
38 public MeasureItemEventArgs(Graphics graphics
, int index
)
41 this.graphics
= graphics
;
44 public MeasureItemEventArgs(Graphics graphics
, int index
, int itemheight
)
47 this.graphics
= graphics
;
48 itemheight
= ItemHeight
;
51 #region Public Properties
53 public Graphics Graphics
95 #region Public Methods
102 /// Compares two MeasureItemEventArgs objects.
103 /// The return value is based on the equivalence of
104 /// graphics, index, itemheight and itemwidth Property
105 /// of the two MeasureItemEventArgs.
107 public static bool operator == (MeasureItemEventArgs MeasureItemEventArgsA
, MeasureItemEventArgs MeasureItemEventArgsB
)
109 return (MeasureItemEventArgsA
.Graphics
== MeasureItemEventArgsB
.Graphics
) &&
110 (MeasureItemEventArgsA
.Index
== MeasureItemEventArgsB
.Index
) &&
111 (MeasureItemEventArgsA
.ItemHeight
== MeasureItemEventArgsB
.ItemHeight
) &&
112 (MeasureItemEventArgsA
.ItemWidth
== MeasureItemEventArgsB
.ItemWidth
);
116 /// Inequality Operator
120 /// Compares two MeasureItemEventArgs objects.
121 /// The return value is based on the equivalence of
122 /// graphics, index, itemheight and itemwidth Property
123 /// of the two MeasureItemEventArgs.
125 public static bool operator != (MeasureItemEventArgs MeasureItemEventArgsA
, MeasureItemEventArgs MeasureItemEventArgsB
)
127 return (MeasureItemEventArgsA
.Graphics
!= MeasureItemEventArgsB
.Graphics
) ||
128 (MeasureItemEventArgsA
.Index
!= MeasureItemEventArgsB
.Index
) ||
129 (MeasureItemEventArgsA
.ItemHeight
!= MeasureItemEventArgsB
.ItemHeight
) ||
130 (MeasureItemEventArgsA
.ItemWidth
!= MeasureItemEventArgsB
.ItemWidth
);
138 /// Checks equivalence of this
139 /// PropertyTabChangedEventArgs and another
142 public override bool Equals (object obj
)
144 if (!(obj
is MeasureItemEventArgs
))return false;
145 return (this == (MeasureItemEventArgs
) obj
);
149 /// GetHashCode Method
153 /// Calculates a hashing value.
156 public override int GetHashCode ()
158 //FIXME: add class specific stuff;
159 return base.GetHashCode();
167 /// Formats the object as a string.
170 public override string ToString ()
172 //FIXME: add class specific stuff;
173 return base.ToString();