void UpdateProgHandler(object sender, cProgArgs args) { /////////////////////////////////////// // so thread don't mess with render // is this being called from main thread? if (main_form.InvokeRequired) { main_form.Invoke(new ProgEventHandler(UpdateProgHandler), new object[] { sender, args }); return; } /////////////////////////////////////// pt.Text = args.msg; pb.Minimum = args.min; pb.Maximum = args.max; pb.Value = args.value; }
public cIAGS() { current_view = null; person_list = new cPersonList(); course_info_list = new cCourseInfoList(); inst_list = new cInstructorList(); section_list = new cSectionList(); assign_list = new cAssignmentList(); signup_list = new cSignupList(); grade_list = new cGradeList(); // view section_view = new cInstSectionView(); inst_signup_view = new cInstSignupView(); inst_assign_view = new cInstAssignView(); inst_grade_view = new cInstGradeView(); // self register for event prog_args = new cProgArgs(); UpdateProg += new ProgEventHandler(UpdateProgHandler); default_dir = Directory.GetCurrentDirectory(); }
void UpdateProgHandler(object sender, cProgArgs args) { /////////////////////////////////////// // so thread don't mess with render // is this being called from main thread? if(main_form.InvokeRequired) { main_form.Invoke(new ProgEventHandler(UpdateProgHandler), new object[] { sender, args } ); return; } /////////////////////////////////////// pt.Text = args.msg; pb.Minimum = args.min; pb.Maximum = args.max; pb.Value = args.value; }