diff --git a/src/Foundation/NSUrl.cs b/src/Foundation/NSUrl.cs index 333602cc8030..aa1f4926b62a 100644 --- a/src/Foundation/NSUrl.cs +++ b/src/Foundation/NSUrl.cs @@ -142,6 +142,21 @@ public bool SetResource (NSString nsUrlResourceKey, NSObject value) return SetResourceValue (value, nsUrlResourceKey, out error); } + public static bool operator == (NSUrl x, NSUrl y) + { + if ((object) x == (object) y) // If both are null, or both are same instance, return true. + return true; + + if (((object) x == null) || ((object) y == null)) // If one is null, but not both, return false. + return false; + + return x.Equals (y); + } + + public static bool operator != (NSUrl x, NSUrl y) + { + return !(x == y); + } } #if !XAMCORE_3_0