private static void shiftFromLast(ImageCacheEntry cacheEntry) { var ratingEntry = cacheEntry.RatingEntry; var previousEntry = ratingEntry.Previous; if (previousEntry != null) { ratingEntry.SwapWith(previousEntry); } }
private bool addFirst(string path, RotateFlipType rotations, Bitmap image) { var key = new Tuple <string, RotateFlipType>(path, rotations); if (_imagesByPath.ContainsKey(key)) { return(false); } _ratings.AddFirst(key); _imagesByPath[key] = new ImageCacheEntry(image, _ratings.First); return(true); }