/// <summary> /// Sort list of photos by number of likes /// </summary> /// <param name="io_ListOfPhotos">List of photos</param> /// <param name="i_Compare"></param> public void SortPhotosByDescendingOrder(List <Photo> io_ListOfPhotos, ICompare i_Compare) { io_ListOfPhotos.Sort((i_NumberOfLikesPhotoOne, i_NumberOfLikesPhotoTwo) => i_Compare.Sorted(i_NumberOfLikesPhotoOne, i_NumberOfLikesPhotoTwo)); io_ListOfPhotos.Reverse(); }
/// <summary> /// Sort list of photos by number of likes /// </summary> /// <param name="io_ListOfPhotos">List of photos</param> /// <param name="i_Compare"></param> public void SortPhotosByDescendingOrder(List<Photo> io_ListOfPhotos, ICompare i_Compare) { io_ListOfPhotos.Sort((i_NumberOfLikesPhotoOne, i_NumberOfLikesPhotoTwo) => i_Compare.Sorted(i_NumberOfLikesPhotoOne, i_NumberOfLikesPhotoTwo)); io_ListOfPhotos.Reverse(); }