Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        protected override void bulkOCRToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (backgroundWorkerBulk != null && backgroundWorkerBulk.IsBusy)
            {
                backgroundWorkerBulk.CancelAsync();
                return;
            }
            if (bulkDialog == null)
            {
                bulkDialog = new BulkDialog();
            }

            bulkDialog.InputFolder = inputFolder;
            bulkDialog.OutputFolder = outputFolder;
            bulkDialog.OutputFormat = outputFormat;

            if (bulkDialog.ShowDialog() == DialogResult.OK)
            {
                inputFolder = bulkDialog.InputFolder;
                outputFolder = bulkDialog.OutputFolder;
                outputFormat = bulkDialog.OutputFormat;

                this.toolStripStatusLabel1.Text = Properties.Resources.OCRrunning;
                this.Cursor = Cursors.WaitCursor;
                this.pictureBox1.UseWaitCursor = true;
                this.textBox1.Cursor = Cursors.WaitCursor;
                this.toolStripProgressBar1.Enabled = true;
                this.toolStripProgressBar1.Visible = true;
                this.toolStripProgressBar1.Style = ProgressBarStyle.Marquee;
                this.bulkOCRToolStripMenuItem.Text = Properties.Resources.CancelBulkOCR;

                if (this.statusForm.IsDisposed)
                {
                    this.statusForm = new StatusForm();
                    statusForm.Text = Properties.Resources.BulkProcessStatus;
                }
                if (!this.statusForm.Visible)
                {
                    this.statusForm.Show();
                }
                else if (this.statusForm.WindowState == FormWindowState.Minimized)
                {
                    this.statusForm.WindowState = FormWindowState.Normal;
                }
                this.statusForm.BringToFront();
                this.statusForm.TextBox.AppendText("\t-- " + Properties.Resources.Beginning_of_task + " --" + Environment.NewLine);

                // start bulk OCR
                stopWatch.Start();
                this.backgroundWorkerBulk.RunWorkerAsync();
            }
        }
Ejemplo n.º 2
0
        protected override void bulkOCRToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (backgroundWorkerBulk != null && backgroundWorkerBulk.IsBusy)
            {
                backgroundWorkerBulk.CancelAsync();
                return;
            }
            if (bulkDialog == null)
            {
                bulkDialog = new BulkDialog();
            }

            bulkDialog.InputFolder  = inputFolder;
            bulkDialog.OutputFolder = outputFolder;
            bulkDialog.OutputFormat = outputFormat;

            if (bulkDialog.ShowDialog() == DialogResult.OK)
            {
                inputFolder  = bulkDialog.InputFolder;
                outputFolder = bulkDialog.OutputFolder;
                outputFormat = bulkDialog.OutputFormat;

                this.toolStripStatusLabel1.Text = Properties.Resources.OCRrunning;
                this.Cursor = Cursors.WaitCursor;
                this.pictureBox1.UseWaitCursor     = true;
                this.textBox1.Cursor               = Cursors.WaitCursor;
                this.toolStripProgressBar1.Enabled = true;
                this.toolStripProgressBar1.Visible = true;
                this.toolStripProgressBar1.Style   = ProgressBarStyle.Marquee;
                this.bulkOCRToolStripMenuItem.Text = Properties.Resources.CancelBulkOCR;

                if (this.statusForm.IsDisposed)
                {
                    this.statusForm = new StatusForm();
                    statusForm.Text = Properties.Resources.BulkProcessStatus;
                }
                if (!this.statusForm.Visible)
                {
                    this.statusForm.Show();
                }
                else if (this.statusForm.WindowState == FormWindowState.Minimized)
                {
                    this.statusForm.WindowState = FormWindowState.Normal;
                }
                this.statusForm.BringToFront();
                this.statusForm.TextBox.AppendText("\t-- " + Properties.Resources.Beginning_of_task + " --" + Environment.NewLine);

                // start bulk OCR
                stopWatch.Start();
                this.backgroundWorkerBulk.RunWorkerAsync();
            }
        }