public void ReportProgress(int progress) { int current = (int)(Convert.ToSingle(progress) * (_percentage / 100f)); _main_progress.ReportProgress(current - _previous_progress); _previous_progress = current; }
public SCETakeCollection LoadData() { int current = 0; SCETakeCollection includes = new SCETakeCollection(); foreach (List <string> each in _packings) { current++; if (_progress.Cancellation) { break; } _progress.ReportProgress(string.Format("下載成績相關資料({0}%)", Math.Round(((float)current / (float)_packings.Count) * 100, 0)), 0); XmlElement xmlRecords = QueryCourse.GetSECTake(each.ToArray()).GetContent().BaseElement; foreach (XmlElement attend in xmlRecords.SelectNodes("Score")) { SCETake include = new SCETake(attend); includes.Add(include); } } return(includes); }
public SCAttendCollection LoadData() { int current = 0; SCAttendCollection objSCAttends = new SCAttendCollection(); foreach (List <string> each in _packings) { current++; if (_progress.Cancellation) { break; } _progress.ReportProgress(string.Format("下載修課相關資料({0}%)", Math.Round(((float)current / (float)_packings.Count) * 100, 0)), 0); XmlElement xmlSCAttends = QueryCourse.GetSCAttendBrief(each.ToArray()).GetContent().BaseElement; foreach (XmlElement attend in xmlSCAttends.SelectNodes("Student")) { SCAttend scattend = new SCAttend(attend); objSCAttends.Add(scattend.Identity, scattend); } } return(objSCAttends); }
private void ReportProgress(string message, int progress) { _progress_ui.ReportProgress(message, progress); }