/* Method to update the tab pane contents. */ void tab_update(LevelGroup lg) { EventHandler updateHandler = delegate(object sender, EventArgs args) { tab_update(lg); }; FormClosedEventHandler formClosedHandler = delegate(object sender, FormClosedEventArgs args) { tab_update(lg); }; Module[] modlist = course.getModules(lg.level); /* Remove controls... */ foreach (ModuleControlGroup mcg in lg.levelControlGroups) { mcg.removeControls(); } lg.levelControlGroups.Clear(); lg.credits = Course.sumModuleCredit(modlist); //Point cur = lg.tabpanel.Location; Point cur = new Point(0, 0); foreach (Module m in modlist) { ModuleControlGroup mcg = new ModuleControlGroup(formClosedHandler, updateHandler, course, lg.level, 120 - lg.credits, m, lg.tabpanel); mcg.addControls(cur, out cur); lg.levelControlGroups.Add(mcg); } }
/* Method to update the tab pane contents. */ void tab_update(LevelGroup lg) { EventHandler updateHandler = delegate(object sender, EventArgs args) { tab_update(lg); }; FormClosedEventHandler formClosedHandler = delegate(object sender, FormClosedEventArgs args) { tab_update(lg); }; Module[] modlist = course.getModules(lg.level); /* Remove controls... */ foreach (ModuleControlGroup mcg in lg.levelControlGroups) { mcg.removeControls(); } lg.levelControlGroups.Clear(); lg.credits = Course.sumModuleCredit(modlist); //Point cur = lg.tabpanel.Location; Point cur = new Point(0, 0); foreach(Module m in modlist) { ModuleControlGroup mcg = new ModuleControlGroup(formClosedHandler, updateHandler, course, lg.level, 120 - lg.credits, m, lg.tabpanel); mcg.addControls(cur, out cur); lg.levelControlGroups.Add(mcg); } }