예제 #1
0
        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");
        }
예제 #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     OperationNotifier.StartWork("SearchInvestments");
     //coordinator.StartWork();
     backgroundWorker.RunWorkerAsync();
 }
예제 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     //coordinator.StartWork();
     OperationNotifier.StartWork("SearchDeposits");
     backgroundWorker.RunWorkerAsync();
 }
예제 #4
0
 private void menu2ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //coordinator.StartWork();
     OperationNotifier.StartWork("SearchInvestments");
     backgroundWorker.RunWorkerAsync();
 }
예제 #5
0
 private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     //coordinator.FinishWork();
     //OperationNotifier.FinishWork("SearchDeposits");
     OperationNotifier.FinishAllWork();
 }