Beispiel #1
0
        private void OpenToyConstructorForm()
        {
            try
            {
                _toysListForm = new ToysListForm(_context);

                _toysListForm.ShowDialog();
            }
            catch (CantConnectToDbException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
 private void ToyConstructorStart()
 {
     //if (backgroundWorker1.IsBusy != true)
     //{
     //    _loadForm = new SimpleLoadingForm();
     //    _loadForm.Show();
     //    this.Hide();
     //    backgroundWorker1.RunWorkerAsync();
     //}
     Hide();
     _toysListForm = new ToysListForm(_context);
     _toysListForm.ShowDialog();
     Show();
 }
Beispiel #3
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            if (worker.CancellationPending == true)
            {
                e.Cancel = true;
                return;
            }
            else
            {
                try
                {
                    _toysListForm = new ToysListForm(_context);
                    worker.ReportProgress(100);
                    _toysListForm.ShowDialog();
                }
                catch (CantConnectToDbException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }