private void timerUpdateActiveJobsView_Tick(object sender, EventArgs e) { try { dsFilesClassification.ActiveJobs.Rows.Clear(); int[] allJobIds = ibp.AllJobs(); if (allJobIds != null) { foreach (int jobId in allJobIds) { DMS.FC.BP.FileClassificatorProgressInfo pInfo = (DMS.FC.BP.FileClassificatorProgressInfo)ibp.GetProgressInfo(jobId); DMS.FC.DsFilesClassification.ActiveJobsRow row = dsFilesClassification.ActiveJobs.NewActiveJobsRow(); row.DateTimeNow = pInfo.timestamp; row.JobId = pInfo.JobId; TimeSpan ts = new TimeSpan(DateTime.Now.Ticks - pInfo.timestamp.Ticks); row.JobProccessingElapsedTime = ts.TotalSeconds; row.JobState = pInfo.JobState.ToString(); row.CountDirs = pInfo.CountDirs; row.CountFiles = pInfo.CountFiles; row.CountResults = pInfo.CountResults; dsFilesClassification.ActiveJobs.Rows.Add(row); } } } catch (Exception ex) { log.Log(mko.Log.RC.CreateError(string.Format("Beim aktualisieren der Liste der aktiven Jobs: {0}", ex.Message))); } }
private void btnActiveJobKillJob_Click(object sender, EventArgs e) { int ixRow = bindingSourceAllActiveJobs.Position; if (ixRow >= 0) { DMS.FC.DsFilesClassification.ActiveJobsRow row = (DMS.FC.DsFilesClassification.ActiveJobsRow)dsFilesClassification.ActiveJobs.Rows[ixRow]; int JobId = row.JobId; ibp.Abort(JobId); btnActiveJobsStartStopAutoUpdate_Click(null, null); } }