Exemplo n.º 1
0
 public void Subscribe(Extract m)
 {
     m.evnt_UpdateCurBar += new Extract.UpdateCurrentBar(UpdateCurrBar);
     m.evnt_UpdatTotBar += new Extract.UpdateTotalBar(UpdateTotaBar);
     m.evnt_UpdateFileName += new Extract.UpdateFileName(UpdateFileName);
     m.evnt_ErrorNotify += new Extract.ErrorNotify(ErrorShowPopup);
     PdfFunctions.evnt_UpdateCurBar += new PdfFunctions.UpdateCurrentBar(UpdateCurrBar);
 }
Exemplo n.º 2
0
 private void UpdateTotaBar(Extract m, EventArgs e)
 {
     this.Invoke((MethodInvoker)delegate
     {
         if (DataAccess.Instance.g_totProgress > 100)
             DataAccess.Instance.g_totProgress = 100;
         pbar_TotalProgress.Value = (int)DataAccess.Instance.g_totProgress;
     });
 }
Exemplo n.º 3
0
        private void UpdateFileName(Extract m, EventArgs e)
        {

            this.Invoke((MethodInvoker)delegate
            {
                lbl_ProcessingFile.Text = Path.GetFileName(DataAccess.Instance.g_WorkingFile);
                if (lbl_ProcessingFile.Text == string.Empty)//finished
                {
                    btn_StartStop.Text = "START";
                   
                }
            });
        }
Exemplo n.º 4
0
        private void btn_StartStop_Click(object sender, EventArgs e)
        {

            if (DataAccess.Instance.g_Processing)
            {
                DataAccess.Instance.g_Processing = false;
                btn_StartStop.Text = "START";
                lbl_ProcessingFile.Text = string.Empty;
            }
            else
            {
                if (((chk_cbr2pdf.Checked) || (chk_pdf2cbr.Checked))&&(_fileSelected))
                {
                    btn_StartStop.Text = "STOP";
                    DataAccess.Instance.g_ReduceSize = chk_ReduceSize.Checked;
                    DataAccess.Instance.g_Processing = true;
                    Extract ex = new Extract();
                    this.Subscribe(ex);
                    ex.BeginExtraction(chk_cbr2pdf.Checked, chk_pdf2cbr.Checked, chk_ReduceSize.Checked, chk_NbPages.Checked, chk_JoinImages.Checked, chk_NbPages.Checked);
                }
            }
        }
Exemplo n.º 5
0
        private void ErrorShowPopup(Extract m, string e)
        {
            this.Invoke((MethodInvoker)delegate
            {
                btn_StartStop.Text = "START";
                pbar_TotalProgress.Value = 0;
                pbar_ActualFile.Value = 0;
                lbl_ProcessingFile.Text =string.Empty;
            });
            MessageBox.Show(e, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);

        }
Exemplo n.º 6
0
        private void ErrorShowPopup(Extract m, string e)
        {
            this.Invoke((MethodInvoker)delegate
            {
                //btn_StartStop.Text = "START";
                //pbar_TotalProgress.Value = 0;
                //pbar_ActualFile.Value = 0;
                //lbl_ProcessingFile.Text =string.Empty;
                listViewLog.Items.Add(new ListViewItem(new List<string>{ (listViewLog.Items.Count + 1).ToString(), e}.ToArray()));
                //this.textBoxLog.Text += e + Environment.NewLine;
                ShowLog();
            });
            //MessageBox.Show(e, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);

        }