示例#1
0
        public void Add(string key, SelfDisposingBitmapDrawable bitmap)
        {
            if (string.IsNullOrWhiteSpace(key) || bitmap == null || _cache.ContainsKey(key))
            {
                return;
            }

            _cache.Add(key, bitmap);
        }
示例#2
0
        public void Add(string key, ImageInformation imageInformation, ISelfDisposingBitmapDrawable bitmap)
        {
            if (string.IsNullOrWhiteSpace(key) || bitmap == null || bitmap.Handle == IntPtr.Zero || !bitmap.HasValidBitmap || _cache.ContainsKey(key))
            {
                return;
            }

            _imageInformations.TryAdd(key, imageInformation);
            _cache.Add(key, bitmap);
        }