// Necessary so this class works as expected in collections. public override nuint GetNativeHash() { nuint hashValue = (ItemNameKey is null) ? 0 : (nuint)ItemNameKey.GetHashCode(); hashValue = hashValue ^ (nuint)Price.GetNativeHash(); hashValue = hashValue ^ (IconImageName is null ? 0 : (nuint)IconImageName.GetHashCode()); hashValue = hashValue ^ (nuint)IsAvailable.GetHashCode(); hashValue = hashValue ^ (nuint)IsDailySpecial.GetHashCode(); return(hashValue); }
override public bool IsEqual(NSObject anObject) { var other = anObject as MenuItem; if (other is null) { return(false); } if (ReferenceEquals(other, this)) { return(true); } bool result = (ItemNameKey.Equals(other.ItemNameKey) && Price.IsEqual(other.Price) && IconImageName.Equals(other.IconImageName) && IsAvailable == other.IsAvailable && IsDailySpecial == other.IsDailySpecial); return(result); }