Beispiel #1
0
 void BitmapImage_DownloadFailed(object sender, System.Windows.Media.ExceptionEventArgs e)
 {
     MessageBox.Show(Resources.txtLoadPictureFailed + "\n\r" + e.ErrorException, Resources.txtEditorName, MessageBoxButton.OK, MessageBoxImage.Exclamation);
     Debug.WriteLine("BitmapImage_DownloadFailed: " + e.ErrorException);
     // TODO: dodelat download failed...Res.imgNotFound;
     //this.Image.Source = System.Windows.Media.Imaging.this.BitmapImage.StreamSource = Res.imgNotFound.GetHbitmap;
 }
Beispiel #2
0
        private void IconBitmapImage_DownloadOrDecodeFailed(object?sender, System.Windows.Media.ExceptionEventArgs e)
        {
            // Fix the bitmap image cache to have default package icon, if some other failure didn't already do that.
            if (!(sender is BitmapImage bitmapImage))
            {
                return;
            }

            var cachedBitmapImage = BitmapImageCache.Get(bitmapImage.UriSource.ToString()) as BitmapSource;

            if (cachedBitmapImage != Images.DefaultPackageIcon)
            {
                AddToCache(bitmapImage.UriSource.ToString(), Images.DefaultPackageIcon);

                if (e.ErrorException is WebException webex && FatalErrors.Any(status => webex.Status == status))
                {
                    ErrorFloodGate.ReportError();
                }
            }
        }
Beispiel #3
0
 private static void property_ValueError(object sender, ExceptionEventArgs e)
 {
     MessageBox.Show(e.EventException.Message);
 }