-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from Gamhub-io/enhancement/optimisation_Loads
Enhancement & optimisation of loads
- Loading branch information
Showing
14 changed files
with
476 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using AresNews.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace AresNews.Helpers.Comparers | ||
{ | ||
public class ArticleComparer : IEqualityComparer<Article> | ||
{ | ||
public bool Equals(Article x, Article y) | ||
{ | ||
if (Object.ReferenceEquals(x, y)) return true; | ||
|
||
if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) | ||
return false; | ||
|
||
// Replace "PropertyName" with the name of the property you want to compare | ||
return x.Id == y.Id; | ||
} | ||
|
||
public int GetHashCode(Article article) | ||
{ | ||
if (Object.ReferenceEquals(article, null)) return 0; | ||
|
||
// Replace "PropertyName" with the name of the property you want to compare | ||
int hashProductName = article.Id == null ? 0 : article.Id.GetHashCode(); | ||
|
||
return hashProductName; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
AresNews/AresNews/Helpers/Converters/ZeroToTrueConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Globalization; | ||
using Xamarin.Forms; | ||
|
||
namespace AresNews.Helpers | ||
{ | ||
public class ZeroToTrueConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return ((int)value) == 0; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
Oops, something went wrong.