Ejemplo n.º 1
0
        public SearchWindow(WorkingData wd, InterSet[] isp)
        {
            int ispl = isp.Length;

            sl = new SearchLog[ispl];
            bw = new BackgroundWorker[ispl];
            InitializeComponent();
            DevideLog(wd);

            pbCondition1.Maximum = wdx[0].Log.Count;
            pbCondition2.Maximum = wdx[1].Log.Count;
            pbConditionA.Maximum = wd.Log.Count;
            pbCondition1.Value   = pbCondition2.Value = pbConditionA.Value = 0;

            btStop.IsEnabled = true;
            for (int i = 0; i < ispl; i++)
            {
                sl[i] = new SearchLog(wdx[i], isp[i].Sea);
                bw[i] = new BackgroundWorker();
                sl[i].SetWorker(bw[i]);
                bw[i].DoWork             += new DoWorkEventHandler(sl[i].StartSearch);
                bw[i].ProgressChanged    += new ProgressChangedEventHandler(ProgressChanged);
                bw[i].RunWorkerCompleted += new RunWorkerCompletedEventHandler(RunWorkerCompleted);

                bw[i].WorkerReportsProgress      = true;
                bw[i].WorkerSupportsCancellation = true;
                bw[i].RunWorkerAsync();
            }
        }
Ejemplo n.º 2
0
        public SearchWindow(WorkingData wd, InterSet[] isp)
        {
            int ispl = isp.Length;
            sl = new SearchLog[ispl];
            bw = new BackgroundWorker[ispl];
            InitializeComponent();
            DevideLog(wd);

            pbCondition1.Maximum = wdx[0].Log.Count;
            pbCondition2.Maximum = wdx[1].Log.Count;
            pbConditionA.Maximum = wd.Log.Count;
            pbCondition1.Value = pbCondition2.Value = pbConditionA.Value = 0;

            btStop.IsEnabled = true;
            for(int i = 0;i < ispl; i++) {
                sl[i] = new SearchLog(wdx[i], isp[i].Sea);
                bw[i] = new BackgroundWorker();
                sl[i].SetWorker(bw[i]);
                bw[i].DoWork += new DoWorkEventHandler(sl[i].StartSearch);
                bw[i].ProgressChanged += new ProgressChangedEventHandler(ProgressChanged);
                bw[i].RunWorkerCompleted += new RunWorkerCompletedEventHandler(RunWorkerCompleted);

                bw[i].WorkerReportsProgress = true;
                bw[i].WorkerSupportsCancellation = true;
                bw[i].RunWorkerAsync();
            }
        }