New tests.
[mono.git] / mcs / class / corlib / System / ConsoleKeyInfo.cs
index 43311b5d6f67d43d6707ffa1220a2d52f0477310..c62c8d0d039ef4e9b679ed87094d12fb475b1767 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.ConsoleKeyInfo
+// System.ConsoleKeyInfo.cs
 //
 // Authors:
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
@@ -27,7 +27,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
 namespace System {
        [Serializable]
        public struct ConsoleKeyInfo {
@@ -80,16 +79,26 @@ namespace System {
                        get { return modifiers; }
                }
                
-               public override bool Equals (object o)
+               public override bool Equals (object value)
                {
-                       if (!(o is ConsoleKeyInfo))
+                       if (!(value is ConsoleKeyInfo))
                                return false;
-                       return Equals ((ConsoleKeyInfo) o);
+                       return Equals ((ConsoleKeyInfo) value);
                }
                
-               public bool Equals (ConsoleKeyInfo o)
+               public static bool operator == (ConsoleKeyInfo a, ConsoleKeyInfo b)
                {
-                       return key == o.key && o.keychar == keychar && o.modifiers == modifiers;
+                       return a.Equals (b);
+               }
+               
+               public static bool operator != (ConsoleKeyInfo a, ConsoleKeyInfo b)
+               {
+                       return !a.Equals (b);
+               }
+               
+               public bool Equals (ConsoleKeyInfo obj)
+               {
+                       return key == obj.key && obj.keychar == keychar && obj.modifiers == modifiers;
                }
                
                public override int GetHashCode ()
@@ -98,5 +107,4 @@ namespace System {
                }
        }
 }
-#endif