/// <summary>
 /// Shows the processing dialog.
 /// </summary>
 /// <returns>
 /// <b>true</b> if form is closed and OK button is pressed;
 /// <b>false</b> if form is closed and not OK button is pressed.
 /// </returns>
 public bool ShowProcessingDialog()
 {
     try
     {
         if (IsPreviewEnabled)
         {
             _imageProcessingPreviewInViewer.StartPreview();
             ExecuteProcessing();
         }
         _isShown = true;
         return(ShowDialog() == DialogResult.OK);
     }
     catch (ImageProcessingException ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return(false);
     }
     finally
     {
         if (IsPreviewEnabled)
         {
             if (IsPreviewEnabled)
             {
                 _imageProcessingPreviewInViewer.StopPreview();
             }
             _isShown = false;
         }
     }
 }
Example #2
0
        /// <summary>
        /// Shows this dialog.
        /// </summary>
        /// <returns><b>True</b> if the color blending confirmed, otherwise - <b>false</b>.</returns>
        public bool ShowProcessingDialog()
        {
            try
            {
                _imageProcessingPreviewInViewer.StartPreview();
                Blend();
            }
            catch (ImageProcessingException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            bool result = ShowDialog() == DialogResult.OK;

            _imageProcessingPreviewInViewer.StopPreview();
            return(result);
        }