Exemplo n.º 1
0
        void m_BackgroundWorker_TamuQPlotCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var tamuQPlotDisplay = new frmQQplotDisplay(mclsQQPar);

            mProgressForm.Hide();
            mProgressForm.DialogResult = DialogResult.Cancel;
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if (e.Cancelled)
            {
                // Next, handle the case where the user canceled
                // the operation.
                // Note that due to a race condition in
                // the DoWork event handler, the Cancelled
                // flag may not have been set, even though
                // CancelAsync was called.
                Console.WriteLine("Cancelled");
            }
            else
            {
                // Finally, handle the case where the operation
                // succeeded.
                //mfrmPlot.Image = e.Result as Image;
                //DialogResult dres = mfrmPlot.ShowDialog();
                var tamuQResult = (clsPlotResult)e.Result;
                tamuQPlotDisplay.Image         = tamuQResult.mImage;
                tamuQPlotDisplay.PlotName      = tamuQResult.mstrPlotName;
                tamuQPlotDisplay.DAnTEinstance = this;
                tamuQPlotDisplay.MdiParent     = m_frmDAnTE.MdiParent;
                tamuQPlotDisplay.Title         = "Tamu-Q Plot";
                tamuQPlotDisplay.Show();
            }
        }
Exemplo n.º 2
0
 void m_BackgroundWorker_QQPlotCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     clsPlotResult mclsPlotResult;
       var mfrmQQplotDisplay = new frmQQplotDisplay(mclsQQPar);
       mfrmShowProgress.Hide();
       mfrmShowProgress.DialogResult = DialogResult.Cancel;
       if (e.Error != null) {
     MessageBox.Show(e.Error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
       } else if (e.Cancelled) {
     // Next, handle the case where the user canceled
     // the operation.
     // Note that due to a race condition in
     // the DoWork event handler, the Cancelled
     // flag may not have been set, even though
     // CancelAsync was called.
     Console.WriteLine("Canceled");
       } else {
     // Finally, handle the case where the operation
     // succeeded.
     //mfrmPlot.Image = e.Result as Image;
     //DialogResult dres = mfrmPlot.ShowDialog();
     mclsPlotResult = (clsPlotResult)e.Result;
     mfrmQQplotDisplay.Image = mclsPlotResult.mImage;
     mfrmQQplotDisplay.PlotName = mclsPlotResult.mstrPlotName;
     mfrmQQplotDisplay.DAnTEinstance = this;
     mfrmQQplotDisplay.MdiParent = m_frmDAnTE.MdiParent;
     mfrmQQplotDisplay.Title = "Q-Q Plot";
     mfrmQQplotDisplay.Show();
       }
 }