**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Windows.Forms / WINELib / MeasureItemEventArgs.cs
blob1f14b6623f4b2390cf46254b5eee4f1ba7a6956d
1 //
2 // System.Windows.Forms.MeasureItemEventArgs.cs
3 //
4 // Author:
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)
8 //
9 // (C) 2002 Ximian, Inc
12 using System;
13 using System.Reflection;
14 using System.Globalization;
15 //using System.Windows.Forms.AccessibleObject.IAccessible;
16 using System.Drawing;
18 namespace System.Windows.Forms {
21 /// <summary>
22 /// </summary>
24 public class MeasureItemEventArgs : EventArgs {
26 #region Fields
28 private Graphics graphics;
29 private int index;
30 private int itemheight = -1;
31 private int itemwidth = -1;
33 #endregion
36 // --- Constructors
38 public MeasureItemEventArgs(Graphics graphics, int index)
40 this.index = index;
41 this.graphics = graphics;
44 public MeasureItemEventArgs(Graphics graphics, int index, int itemheight)
46 this.index = index;
47 this.graphics = graphics;
48 itemheight = ItemHeight;
51 #region Public Properties
53 public Graphics Graphics
55 get
57 return graphics;
61 public int Index
63 get
65 return index;
69 public int ItemHeight
71 get
73 return itemheight;
75 set
77 itemheight = value;
81 public int ItemWidth
83 get
85 return itemwidth;
87 set
89 itemwidth = value;
93 #endregion
95 #region Public Methods
97 /// <summary>
98 /// Equality Operator
99 /// </summary>
101 /// <remarks>
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.
106 /// </remarks>
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);
115 /// <summary>
116 /// Inequality Operator
117 /// </summary>
119 /// <remarks>
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.
124 /// </remarks>
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);
133 /// <summary>
134 /// Equals Method
135 /// </summary>
137 /// <remarks>
138 /// Checks equivalence of this
139 /// PropertyTabChangedEventArgs and another
140 /// object.
141 /// </remarks>
142 public override bool Equals (object obj)
144 if (!(obj is MeasureItemEventArgs))return false;
145 return (this == (MeasureItemEventArgs) obj);
148 /// <summary>
149 /// GetHashCode Method
150 /// </summary>
152 /// <remarks>
153 /// Calculates a hashing value.
154 /// </remarks>
155 [MonoTODO]
156 public override int GetHashCode ()
158 //FIXME: add class specific stuff;
159 return base.GetHashCode();
162 /// <summary>
163 /// ToString Method
164 /// </summary>
166 /// <remarks>
167 /// Formats the object as a string.
168 /// </remarks>
169 [MonoTODO]
170 public override string ToString ()
172 //FIXME: add class specific stuff;
173 return base.ToString();
176 #endregion