Browse Source

Merge branch 'master' into features/support-opengles-v3

danwalmsley 5 years ago
parent
commit
54e77fb29a
2 changed files with 7 additions and 9 deletions
  1. 5 7
      src/Avalonia.Input/KeyGesture.cs
  2. 2 2
      src/Avalonia.Input/PointerEventArgs.cs

+ 5 - 7
src/Avalonia.Input/KeyGesture.cs

@@ -1,7 +1,5 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
 using System.Text;
 using System.Text;
 
 
 namespace Avalonia.Input
 namespace Avalonia.Input
@@ -29,7 +27,7 @@ namespace Avalonia.Input
             KeyModifiers = modifiers;
             KeyModifiers = modifiers;
         }
         }
 
 
-        public bool Equals(KeyGesture other)
+        public bool Equals(KeyGesture? other)
         {
         {
             if (ReferenceEquals(null, other)) return false;
             if (ReferenceEquals(null, other)) return false;
             if (ReferenceEquals(this, other)) return true;
             if (ReferenceEquals(this, other)) return true;
@@ -37,12 +35,12 @@ namespace Avalonia.Input
             return Key == other.Key && KeyModifiers == other.KeyModifiers;
             return Key == other.Key && KeyModifiers == other.KeyModifiers;
         }
         }
 
 
-        public override bool Equals(object obj)
+        public override bool Equals(object? obj)
         {
         {
             if (ReferenceEquals(null, obj)) return false;
             if (ReferenceEquals(null, obj)) return false;
             if (ReferenceEquals(this, obj)) return true;
             if (ReferenceEquals(this, obj)) return true;
 
 
-            return obj is KeyGesture && Equals((KeyGesture)obj);
+            return obj is KeyGesture gesture && Equals(gesture);
         }
         }
 
 
         public override int GetHashCode()
         public override int GetHashCode()
@@ -53,12 +51,12 @@ namespace Avalonia.Input
             }
             }
         }
         }
 
 
-        public static bool operator ==(KeyGesture left, KeyGesture right)
+        public static bool operator ==(KeyGesture? left, KeyGesture? right)
         {
         {
             return Equals(left, right);
             return Equals(left, right);
         }
         }
 
 
-        public static bool operator !=(KeyGesture left, KeyGesture right)
+        public static bool operator !=(KeyGesture? left, KeyGesture? right)
         {
         {
             return !Equals(left, right);
             return !Equals(left, right);
         }
         }

+ 2 - 2
src/Avalonia.Input/PointerEventArgs.cs

@@ -86,14 +86,14 @@ namespace Avalonia.Input
         }
         }
 
 
         [Obsolete("Use GetCurrentPoint")]
         [Obsolete("Use GetCurrentPoint")]
-        public PointerPoint GetPointerPoint(IVisual relativeTo) => GetCurrentPoint(relativeTo);
+        public PointerPoint GetPointerPoint(IVisual? relativeTo) => GetCurrentPoint(relativeTo);
         
         
         /// <summary>
         /// <summary>
         /// Returns the PointerPoint associated with the current event
         /// Returns the PointerPoint associated with the current event
         /// </summary>
         /// </summary>
         /// <param name="relativeTo">The visual which coordinate system to use. Pass null for toplevel coordinate system</param>
         /// <param name="relativeTo">The visual which coordinate system to use. Pass null for toplevel coordinate system</param>
         /// <returns></returns>
         /// <returns></returns>
-        public PointerPoint GetCurrentPoint(IVisual relativeTo)
+        public PointerPoint GetCurrentPoint(IVisual? relativeTo)
             => new PointerPoint(Pointer, GetPosition(relativeTo), _properties);
             => new PointerPoint(Pointer, GetPosition(relativeTo), _properties);
 
 
         /// <summary>
         /// <summary>