Sample.ProgressBarForm.EndProgress C# (CSharp) Method

EndProgress() public method

public EndProgress ( ) : void
return void
        public void EndProgress()
        {
            Application.UseWaitCursor = false;
            Application.RemoveMessageFilter( this );
            base.Close();
        }

Usage Example

コード例 #1
0
ファイル: MainForm.cs プロジェクト: abbyysdk/ocrsdk.com
        private void startRecognition_Click( object sender, EventArgs e )
        {
            try {
                sourceDataSplitContainer.Enabled = false;
                resultSplitContainer.Enabled = false;

                ProgressBarForm progress = new ProgressBarForm( this );
                try {
                    processor.StepChangedAction = progress.ShowMessage;
                    processor.ProgressChangedAction = progress.ShowProgress;

                    ProcessingSettings settings = new ProcessingSettings();
                    settings.Country = (CountryOfOrigin)receiptCountries[countryComboBox.Text];
                    settings.TreatAsPhoto = treatAsPhotoCheckBox.Checked;

                    string result = processor.Process( imageFileTextBox.Text, settings );
                    receiptPictureBox.Image = sourceFilePictureBox.Image;
                    if( !String.IsNullOrEmpty( result ) ) {
                        fillReceiptFields( result );
                    }

                    resultSplitContainer.Panel1Collapsed = true;
                    //refreshGraphics();
                    showReceipt();
                } finally {
                    processor.ProgressChangedAction = null;
                    processor.StepChangedAction = null;
                    progress.EndProgress();
                }
            } catch( Exception exception ) {
                MessageBox.Show( this, exception.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
            } finally {
                sourceDataSplitContainer.Enabled = true;
                resultSplitContainer.Enabled = true;
            }
        }