예제 #1
0
        private void cmbLevel_SelectedIndexChanged(object sender, EventArgs e)
        {
            var level = from b in db.Modules where b.LevelID == "4" select b;

            switch (cmbLevel.SelectedIndex)
            {
            case 0:
                level      = from b in db.Modules where b.LevelID == "4" select b;
                curLevelID = "4";
                break;

            case 1:
                level      = from b in db.Modules where b.LevelID == "5" select b;
                curLevelID = "5";
                break;

            case 2:
                level      = from b in db.Modules where b.LevelID == "6" select b;
                curLevelID = "6";
                break;
            }

            panelModule.Controls.Clear();
            moduleControlMap = new Dictionary <string, ModuleControl>();

            foreach (Module module in level)
            {
                ModuleControl mdlc = new ModuleControl(module);
                moduleControlMap.Add(module.ModuleID, mdlc);
                panelModule.Controls.Add(mdlc);
                mdlc.childComponentChanged += new ModuleControl.ComponentChanged(moduleChange);
            }
            displayModuleMarks();
        }
예제 #2
0
        public void addModule(Module mod)
        {
            ModuleControl control = new ModuleControl(mod);

            panelModule.Controls.Add(control);
        }