/* Create calculator accoring to the input checkedlist and pass to BackgroundWorker */ public void calculateMetricsAsync(GroupsCheckedList checkedlist) { if (m_oBackgroundWorker != null && m_oBackgroundWorker.IsBusy) { /* throw new InvalidOperationException(String.Format( "{0}:{1}: An asynchronous operation is already in progress." , this.ClassName, MethodName )); * */ } CalculateGroupsAsyncArgs args = new CalculateGroupsAsyncArgs(); // add analyzer to this object and pass to BackgroundWorker if (checkedlist.Fan_Motif == true) { } if (checkedlist.Dconnector_Motif == true && checkedlist.dMininum > 0 && checkedlist.dMaximum > 0) { } if (checkedlist.WakitaTsurumi_Cluster == true) { } // create a new BackgroundWorker m_oBackgroundWorker = new BackgroundWorker(); m_oBackgroundWorker.DoWork += new DoWorkEventHandler(BackgroundWorker_DoWork); m_oBackgroundWorker.ProgressChanged += new ProgressChangedEventHandler(BackgroundWorker_ProgressChanged); m_oBackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BackgroundWorker_RunWorkerCompleted); m_oBackgroundWorker.RunWorkerAsync(args); }
public GroupCalculationProgressDialog(GroupsCheckedList chkList) { InitializeComponent(); m_oGroupsCheckedList = chkList; m_oGroupCalculatorManager = new GroupCalculatorManager(); m_oGroupCalculatorManager.CalculationProgressChanged += new ProgressChangedEventHandler(Manager_ProgressChanged); m_oGroupCalculatorManager.CalculationCompleted += new RunWorkerCompletedEventHandler(Manager_WorksCompleted); }