public Form1() { InitializeComponent(); backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork); backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted); //coordinator.RegisterInterface(userControlA1); //coordinator.RegisterInterface(userControlB1); //coordinator.RegisterControl(button1); //coordinator.RegisterControl(button2); //coordinator.RegisterControl(button3, new AsyncWorkingControlBehaviour { VisibleWhenWorking = false, VisibleWhenComplete = true, EnabledWhenComplete = true } ); ////coordinator.UnregisterControl(button1); //OperationNotifier. //OperationNotifier.RegisterOperation("SearchDeposits"); //OperationNotifier.RegisterOperation("SearchInvestments"); OperationNotifier.Register("SearchDeposits", userControlA1); OperationNotifier.Register("SearchInvestments", userControlB1); //OperationNotifier. //OperationNotifier.UnregisterOperation("SearchDeposits"); }
private void button2_Click(object sender, EventArgs e) { OperationNotifier.StartWork("SearchInvestments"); //coordinator.StartWork(); backgroundWorker.RunWorkerAsync(); }
private void button1_Click(object sender, EventArgs e) { //coordinator.StartWork(); OperationNotifier.StartWork("SearchDeposits"); backgroundWorker.RunWorkerAsync(); }
private void menu2ToolStripMenuItem_Click(object sender, EventArgs e) { //coordinator.StartWork(); OperationNotifier.StartWork("SearchInvestments"); backgroundWorker.RunWorkerAsync(); }
private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { //coordinator.FinishWork(); //OperationNotifier.FinishWork("SearchDeposits"); OperationNotifier.FinishAllWork(); }