private void exportSubjectButton_Click(object sender, EventArgs e)
        {
            if (currentSubject != null)
            {
                SaveFileDialog sp = new SaveFileDialog();
                sp.InitialDirectory = Environment.SpecialFolder.Desktop.ToString();
                sp.Filter           = "CSV File|*.csv";
                sp.Title            = "Save study as one file.";


                if (sp.ShowDialog() == DialogResult.OK)
                {
                    // TODO: Commit task to BGWOrker
                    ExportingProgress ep = new ExportingProgress();
                    ep.Show();

                    bw.DoWork += (_sender, _e) => _e.Result = runExportSubject(database, currentStudy, currentSubject, sp.FileName);

                    bw.RunWorkerAsync();
                    //exporter.ExportSubjectToCSVOneFile(database, currentStudy, currentSubject, sp.FileName);
                    while (bw.IsBusy)
                    {
                        Thread.Sleep(100);
                        ep.currentFileLabel.Text   = exporter.status;
                        ep.exportProgressBar.Value = exporter.percent;
                        ep.exportProgressBar.Update();
                        ep.Update();
                        Application.DoEvents();
                    }
                    ep.Hide();
                }
            }
        }
        private void exportSubjectByTrialButton_Click(object sender, EventArgs e)
        {
            if (currentSubject != null)
            {
                FolderBrowserDialog sp = new FolderBrowserDialog();
                sp.RootFolder = Environment.SpecialFolder.Desktop;


                if (sp.ShowDialog() == DialogResult.OK)
                {
                    // TODO: Commit task to BGWOrker
                    ExportingProgress ep = new ExportingProgress();
                    ep.Show();
                    ep.exportProgressBar.Style = ProgressBarStyle.Continuous;

                    bw.DoWork += (_sender, _e) => _e.Result = runExportSubjectByTrial(database, currentStudy, currentSubject, sp.SelectedPath);

                    bw.RunWorkerAsync();
                    //exporter.ExportSubjectToCSVOneFile(database, currentStudy, currentSubject, sp.FileName);
                    while (bw.IsBusy)
                    {
                        Thread.Sleep(100);
                        ep.currentFileLabel.Text   = exporter.status;
                        ep.exportProgressBar.Value = exporter.percent;
                        ep.exportProgressBar.Update();
                        ep.Update();
                        Application.DoEvents();
                    }
                    ep.Hide();
                }
            }
        }
Esempio n. 3
0
        private void exportSubjectByTrialButton_Click(object sender, EventArgs e)
        {
            if(currentSubject != null)
            {
                FolderBrowserDialog sp = new FolderBrowserDialog();
                sp.RootFolder = Environment.SpecialFolder.Desktop;

                if (sp.ShowDialog() == DialogResult.OK)
                {
                    // TODO: Commit task to BGWOrker
                    ExportingProgress ep = new ExportingProgress();
                    ep.Show();
                    ep.exportProgressBar.Style = ProgressBarStyle.Continuous;

                    bw.DoWork += (_sender, _e) => _e.Result = runExportSubjectByTrial(database, currentStudy, currentSubject, sp.SelectedPath);

                    bw.RunWorkerAsync();
                    //exporter.ExportSubjectToCSVOneFile(database, currentStudy, currentSubject, sp.FileName);
                    while (bw.IsBusy)
                    {
                        Thread.Sleep(100);
                        ep.currentFileLabel.Text = exporter.status;
                        ep.exportProgressBar.Value = exporter.percent;
                        ep.exportProgressBar.Update();
                        ep.Update();
                        Application.DoEvents();
                    }
                    ep.Hide();
                }
            }
        }
Esempio n. 4
0
        private void exportSubjectButton_Click(object sender, EventArgs e)
        {
            if (currentSubject != null)
            {
                SaveFileDialog sp = new SaveFileDialog();
                sp.InitialDirectory = Environment.SpecialFolder.Desktop.ToString();
                sp.Filter = "CSV File|*.csv";
                sp.Title = "Save study as one file.";

                if (sp.ShowDialog() == DialogResult.OK)
                {
                    // TODO: Commit task to BGWOrker
                    ExportingProgress ep = new ExportingProgress();
                    ep.Show();

                    bw.DoWork += (_sender, _e) => _e.Result = runExportSubject(database, currentStudy, currentSubject, sp.FileName);

                    bw.RunWorkerAsync();
                    //exporter.ExportSubjectToCSVOneFile(database, currentStudy, currentSubject, sp.FileName);
                    while (bw.IsBusy)
                    {
                        Thread.Sleep(100);
                        ep.currentFileLabel.Text = exporter.status;
                        ep.exportProgressBar.Value = exporter.percent;
                        ep.exportProgressBar.Update();
                        ep.Update();
                        Application.DoEvents();
                    }
                    ep.Hide();
                }
            }
        }