Example #1
0
        private async Task <BitmapSource> LoadThumbnailAsync(IGoogleDriveFile file, Stream stream)
        {
            if (file.ThumbnailLink.HasValue())
            {
                return(await WebImageDownloader.DownloadAsync(file.ThumbnailLink));
            }

            return(BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad));
        }
Example #2
0
        private void DownloadAllImages_Click(object sender, EventArgs e)
        {
            var files = new WebImageDownloader(URL).GetSafeUrls();

            if (files.Count == 0)
            {
                MessageBox.Show("There are either no images to download from this page, or OSIRT is unable to download them.", "No Images to Download", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            using (var downloader = new DownloadForm(files, Enums.Actions.Scraped))
            {
                downloader.ShowDialog();
            }
        }
Example #3
0
        private async Task <GoogleDriveFileInfoModel> DoLoadThumbnailInfoAsync(IGoogleDriveFile file)
        {
            var imageSource = await WebImageDownloader.DownloadAsync(file.ThumbnailLink);

            return(CreateFileInfo(file, imageSource));
        }
Example #4
0
        private void DownloadAllImages_Click(object sender, EventArgs e)
        {
            var files = new WebImageDownloader(URL).GetSafeUrls();

            if (files.Count == 0)
            {
                MessageBox.Show("There are either no images to download from this page, or OSIRT is unable to download them.", "No Images to Download", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            using (var downloader = new DownloadForm(files, Enums.Actions.Scraped))
            {
                downloader.ShowDialog();
            }
        }