| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- //
- // System.Windows.Forms.MeasureItemEventArgs.cs
- //
- // Author:
- // stubbed out by Paul Osman ([email protected])
- // Partially completed by Dennis Hayes ([email protected])
- // Gianandrea Terzi ([email protected])
- //
- // (C) 2002 Ximian, Inc
- //
- using System;
- using System.Reflection;
- using System.Globalization;
- //using System.Windows.Forms.AccessibleObject.IAccessible;
- using System.Drawing;
- namespace System.Windows.Forms {
- /// <summary>
- /// </summary>
- public class MeasureItemEventArgs : EventArgs {
- #region Fields
- private Graphics graphics;
- private int index;
- private int itemheight = -1;
- private int itemwidth = -1;
- #endregion
- //
- // --- Constructors
- //
- public MeasureItemEventArgs(Graphics graphics, int index)
- {
- this.index = index;
- this.graphics = graphics;
- }
- public MeasureItemEventArgs(Graphics graphics, int index, int itemheight)
- {
- this.index = index;
- this.graphics = graphics;
- itemheight = ItemHeight;
- }
- #region Public Properties
- public Graphics Graphics
- {
- get
- {
- return graphics;
- }
- }
- public int Index
- {
- get
- {
- return index;
- }
- }
- public int ItemHeight
- {
- get
- {
- return itemheight;
- }
- set
- {
- itemheight = value;
- }
- }
- public int ItemWidth
- {
- get
- {
- return itemwidth;
- }
- set
- {
- itemwidth = value;
- }
- }
- #endregion
-
- #region Public Methods
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two MeasureItemEventArgs objects.
- /// The return value is based on the equivalence of
- /// graphics, index, itemheight and itemwidth Property
- /// of the two MeasureItemEventArgs.
- /// </remarks>
- public static bool operator == (MeasureItemEventArgs MeasureItemEventArgsA, MeasureItemEventArgs MeasureItemEventArgsB)
- {
- return (MeasureItemEventArgsA.Graphics == MeasureItemEventArgsB.Graphics) &&
- (MeasureItemEventArgsA.Index == MeasureItemEventArgsB.Index) &&
- (MeasureItemEventArgsA.ItemHeight == MeasureItemEventArgsB.ItemHeight) &&
- (MeasureItemEventArgsA.ItemWidth == MeasureItemEventArgsB.ItemWidth);
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two MeasureItemEventArgs objects.
- /// The return value is based on the equivalence of
- /// graphics, index, itemheight and itemwidth Property
- /// of the two MeasureItemEventArgs.
- /// </remarks>
- public static bool operator != (MeasureItemEventArgs MeasureItemEventArgsA, MeasureItemEventArgs MeasureItemEventArgsB)
- {
- return (MeasureItemEventArgsA.Graphics != MeasureItemEventArgsB.Graphics) ||
- (MeasureItemEventArgsA.Index != MeasureItemEventArgsB.Index) ||
- (MeasureItemEventArgsA.ItemHeight != MeasureItemEventArgsB.ItemHeight) ||
- (MeasureItemEventArgsA.ItemWidth != MeasureItemEventArgsB.ItemWidth);
- }
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this
- /// PropertyTabChangedEventArgs and another
- /// object.
- /// </remarks>
- public override bool Equals (object obj)
- {
- if (!(obj is MeasureItemEventArgs))return false;
- return (this == (MeasureItemEventArgs) obj);
- }
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
- [MonoTODO]
- public override int GetHashCode ()
- {
- //FIXME: add class specific stuff;
- return base.GetHashCode();
- }
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the object as a string.
- /// </remarks>
- [MonoTODO]
- public override string ToString ()
- {
- //FIXME: add class specific stuff;
- return base.ToString();
- }
- #endregion
- }
- }
-
|