private void method(object sender, ResearchEventArgs e)
 {
     ResearchStatus rs = GetSubresearchStatus(e.ResearchID);
     if (rs == ResearchStatus.Completed)
     {
         Interlocked.Increment(ref currentResearchIndex);
         if (currentResearchIndex >= subResearches.Count())
             StatusInfo = new ResearchStatusInfo(ResearchStatus.Completed, (uint)currentResearchIndex);
         else
         {
             StatusInfo = new ResearchStatusInfo(ResearchStatus.Running, StatusInfo.CompletedStepsCount + 1);
             subResearches[currentResearchIndex].StartResearch();
         }
     }
 }
        private void UpdateStatusesInTableAndInPanel(object sender, ResearchEventArgs e)
        {
            Guid id = e.ResearchID;
            ResearchStatusInfo rsi = SessionManager.GetResearchStatus(id);
            string status = rsi.Status.ToString() + " ";
            double percent = rsi.CompletedStepsCount * 100.0 / SessionManager.GetProcessStepsCount(id);
            status += Math.Round(percent, 1).ToString() + "%";

            DataGridViewRow r = FindRowInTableById(id);
            Debug.Assert(r != null);
            r.Cells["statusColumn"].Value = status;

            if (GetSelectedResearchId() == id)
            {
                statusProgress.Visible = true;
                statusProgress.Maximum = SessionManager.GetProcessStepsCount(id);
                statusProgress.Value = (int)rsi.CompletedStepsCount;
            }
        }
예제 #3
0
 private void CurrentResearch_OnResearchUpdateStatus(object sender, ResearchEventArgs e)
 {
     int researchIndex = researchIDs.IndexOf(e.ResearchID);
     researchesTable.Rows[researchIndex].Cells["statusColumn"].Value = e.Status.ToString();
     stopResearch.Enabled = (ResearchStatus.Running == e.Status);
 }
 private void CurrentResearch_OnResearchUpdateStatus(object sender, ResearchEventArgs e)
 {
     statusTable.Rows[0].Cells["statusStatusColumn"].Value = e.Status.ToString();
 }