Merge pull request #72 from mandel-macaque/bug-34816

[Fix] Overload the == and != operators of the NSUrl class.
This commit is contained in:
Manuel de la Pena 2016-05-23 15:51:22 +02:00
Родитель 6ca327e193 ed746c8a2a
Коммит 9b240474b5
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -142,6 +142,21 @@ namespace XamCore.Foundation {
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