ShowErrorImage() public method

public ShowErrorImage ( ) : void
return void
Beispiel #1
0
        public void SizeMode_ErrorImageTest2()
        {
            using (var picbox = new OTPictureBox())
            {
                picbox.ShowErrorImage();

                picbox.SizeMode = PictureBoxSizeMode.Zoom;

                Assert.Equal(PictureBoxSizeMode.Zoom, picbox.SizeMode);
                Assert.Equal(PictureBoxSizeMode.CenterImage, ((PictureBox)picbox).SizeMode);
            }
        }
Beispiel #2
0
        public void SizeMode_ErrorImageTest2()
        {
            using (var picbox = new OTPictureBox())
            {
                picbox.ShowErrorImage();

                picbox.SizeMode = PictureBoxSizeMode.Zoom;

                Assert.Equal(PictureBoxSizeMode.Zoom, picbox.SizeMode);
                Assert.Equal(PictureBoxSizeMode.CenterImage, ((PictureBox)picbox).SizeMode);
            }
        }
Beispiel #3
0
        public void SizeMode_RestoreTest()
        {
            using (var picbox = new OTPictureBox())
            {
                picbox.SizeMode = PictureBoxSizeMode.Zoom;

                picbox.ShowErrorImage();

                picbox.Image = TestUtils.CreateDummyImage();

                Assert.Equal(PictureBoxSizeMode.Zoom, picbox.SizeMode);
                Assert.Equal(PictureBoxSizeMode.Zoom, ((PictureBox)picbox).SizeMode);
            }
        }
Beispiel #4
0
        public void SizeMode_RestoreTest()
        {
            using (var picbox = new OTPictureBox())
            {
                picbox.SizeMode = PictureBoxSizeMode.Zoom;

                picbox.ShowErrorImage();

                picbox.Image = TestUtils.CreateDummyImage();

                Assert.Equal(PictureBoxSizeMode.Zoom, picbox.SizeMode);
                Assert.Equal(PictureBoxSizeMode.Zoom, ((PictureBox)picbox).SizeMode);
            }
        }
Beispiel #5
0
        private async Task SetThumbnailImageAsync(OTPictureBox picbox, ThumbnailInfo thumbInfo,
            CancellationToken cancelToken)
        {
            try
            {
                picbox.ShowInitialImage();

                picbox.MouseDown += this.pictureBox_MouseDown;
                picbox.MouseUp += this.pictureBox_MouseUp;

                picbox.Image = await thumbInfo.LoadThumbnailImageAsync(cancelToken);

                cancelToken.ThrowIfCancellationRequested();

                picbox.MouseMove += this.pictureBox_MouseMove;

                if (this.ThumbnailLoadCompleted != null)
                    this.ThumbnailLoadCompleted(picbox, EventArgs.Empty);
            }
            catch (Exception)
            {
                picbox.ShowErrorImage();
                try
                {
                    throw;
                }
                catch (HttpRequestException) { }
                catch (InvalidImageException) { }
                catch (TaskCanceledException) { }
                catch (WebException) { }
            }
        }
Beispiel #6
0
 private async Task SetThumbnailImageAsync(OTPictureBox picbox, ThumbnailInfo thumbInfo,
     CancellationToken cancelToken)
 {
     try
     {
         picbox.ShowInitialImage();
         picbox.Image = await thumbInfo.LoadThumbnailImageAsync(cancelToken);
     }
     catch (Exception)
     {
         picbox.ShowErrorImage();
         try
         {
             throw;
         }
         catch (HttpRequestException) { }
         catch (InvalidImageException) { }
         catch (TaskCanceledException) { }
     }
 }