2 // System.Windows.Forms.KeyPressEventArgs.cs
\r
5 // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
\r
6 // Dennis Hayes (dennish@Raytek.com)
\r
7 // Gianandrea Terzi (gterzi@lario.com)
\r
9 // (C) 2002 Ximian, Inc
\r
12 using System.Runtime.InteropServices;
\r
14 namespace System.Windows.Forms {
\r
17 // This is only a template. Nothing is implemented yet.
\r
20 public class KeyPressEventArgs : EventArgs {
\r
24 private char keychar;
\r
25 private bool handled = false; //Gian : Initialize?
\r
32 public KeyPressEventArgs (char keyChar)
\r
34 this.keychar = keyChar;
\r
37 #region Public Properties
\r
39 public bool Handled {
\r
49 public char KeyChar {
\r
56 #region Public Methods
\r
59 /// Equality Operator
\r
63 /// Compares two KeyPressEventArgs objects.
\r
64 /// The return value is based on the equivalence of
\r
65 /// Handled and KeyChar Property
\r
66 /// of the two KeyPressEventArgs.
\r
68 public static bool operator == (KeyPressEventArgs KeyPressEventArgsA, KeyPressEventArgs KeyPressEventArgsB)
\r
70 return (KeyPressEventArgsA.Handled == KeyPressEventArgsB.Handled) && (KeyPressEventArgsA.KeyChar == KeyPressEventArgsB.KeyChar);
\r
74 /// Inequality Operator
\r
78 /// Compares two KeyPressEventArgs objects.
\r
79 /// The return value is based on the equivalence of
\r
80 /// Handled and KeyChar Property
\r
81 /// of the two KeyPressEventArgs.
\r
83 public static bool operator != (KeyPressEventArgs KeyPressEventArgsA, KeyPressEventArgs KeyPressEventArgsB)
\r
85 return (KeyPressEventArgsA.Handled != KeyPressEventArgsB.Handled) || (KeyPressEventArgsA.KeyChar != KeyPressEventArgsB.KeyChar);
\r
93 /// Checks equivalence of this
\r
94 /// LayoutEventArgs and another
\r
97 public override bool Equals (object obj)
\r
99 if (!(obj is KeyPressEventArgs))return false;
\r
100 return (this == (KeyPressEventArgs) obj);
\r
104 /// GetHashCode Method
\r
108 /// Calculates a hashing value.
\r
111 public override int GetHashCode ()
\r
113 //FIXME: add class specific stuff;
\r
114 return base.GetHashCode();
\r
118 /// ToString Method
\r
122 /// Formats the object as a string.
\r
125 public override string ToString ()
\r
127 //FIXME: add class specific stuff;
\r
128 return base.ToString();
\r