Exemplo n.º 1
0
        private static void shiftFromLast(ImageCacheEntry cacheEntry)
        {
            var ratingEntry   = cacheEntry.RatingEntry;
            var previousEntry = ratingEntry.Previous;

            if (previousEntry != null)
            {
                ratingEntry.SwapWith(previousEntry);
            }
        }
Exemplo n.º 2
0
        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);
        }