Пример #1
0
        public LoadThumbnailResult(ThumbnailDescriptor descriptor, Exception error)
        {
            Platform.CheckForNullReference(descriptor, "descriptor");
            Platform.CheckForNullReference(error, "error");

            Descriptor = descriptor;
            Error      = error;
        }
Пример #2
0
        public LoadThumbnailResult(ThumbnailDescriptor descriptor, IImageData thumbnailData, Size size)
        {
            Platform.CheckForNullReference(descriptor, "descriptor");
            Platform.CheckForNullReference(thumbnailData, "thumbnailData");

            Size          = size;
            Descriptor    = descriptor;
            ThumbnailData = thumbnailData;
        }
Пример #3
0
        public LoadThumbnailRequest(ThumbnailDescriptor descriptor, Size size, Action <LoadThumbnailResult> resultCallback)
        {
            Platform.CheckForNullReference(descriptor, "descriptor");
            Platform.CheckForNullReference(resultCallback, "resultCallback");

            Descriptor     = descriptor;
            Size           = size;
            ResultCallback = resultCallback;
        }
Пример #4
0
            private void UpdateImage()
            {
                if (_isImageLoaded || ThumbnailSize.IsEmpty)
                {
                    return;
                }

                var descriptor = ThumbnailDescriptor.Create((IDisplaySet)Item, true);

                if (descriptor == null)
                {
                    if (!_isImageValid)
                    {
                        ImageData     = Loader.GetDummyThumbnail(_factory.NoImagesMessage, _thumbnailSize);
                        _isImageValid = true;
                    }
                }
                else
                {
                    IImageData imageData;
                    if (!_isImageValid && Loader.TryGetThumbnail(descriptor, _thumbnailSize, out imageData))
                    {
                        ImageData     = imageData;
                        _isImageValid = _isImageLoaded = true;
                    }
                    else
                    {
                        if (!_isImageValid)
                        {
                            ImageData     = Loader.GetDummyThumbnail(_factory.LoadingMessage, _thumbnailSize);
                            _isImageValid = true;
                        }

                        Loader.LoadThumbnailAsync(new LoadThumbnailRequest(descriptor, _thumbnailSize, OnThumbnailLoadedAsync));
                    }
                }
            }
Пример #5
0
 public override IImageData GetThumbnail(ThumbnailDescriptor descriptor, Size size)
 {
     return(_factory.CreateImage(descriptor.ReferenceImage, size));
 }
Пример #6
0
 public override bool TryGetThumbnail(ThumbnailDescriptor descriptor, Size size, out IImageData thumbnail)
 {
     thumbnail = null;
     return(false);
 }
Пример #7
0
 public abstract IImageData GetThumbnail(ThumbnailDescriptor descriptor, Size size);
Пример #8
0
 public abstract bool TryGetThumbnail(ThumbnailDescriptor descriptor, Size size, out IImageData thumbnail);
Пример #9
0
 public bool TryGetThumbnail(ThumbnailDescriptor descriptor, Size size, out IImageData bitmap)
 {
     return(_repository.TryGetThumbnail(descriptor, size, out bitmap));
 }