private void 打开ToolStripMenuItem_Click(object sender, EventArgs e) { if (openfile.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var skillList = new List <Skill>(); var pointList = new List <PointF>(); StreamReader reader = new StreamReader(openfile.FileName, Encoding.Default); try { MainDV.size_circle = Convert.ToInt32(reader.ReadLine()); int n = Convert.ToInt32(reader.ReadLine()); for (int i = 0; i < n; i++) { Skill curr = (Skill)reader.ReadLine(); skillList.Add(curr); } for (int i = 0; i < n; i++) { string[] coordinate = reader.ReadLine().Split(','); float x = (float)Convert.ToDouble(coordinate[0]); float y = (float)Convert.ToDouble(coordinate[1]); pointList.Add(new PointF(x, y)); } } catch (Exception ex) { MessageBox.Show("该文件损坏"); return; } MainDV.ShowRelation(skillList, pointList); MainDV.Flash(); } }
private void 从文件读取_Click(object sender, EventArgs e) { if (openScheme.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ColorScheme scheme = new ColorScheme(); StreamReader reader = new StreamReader(openScheme.FileName, Encoding.Default); int length = ColorScheme.Size; string[] lists = new string[length]; try { for (int i = 0; i < length; i++) { lists[i] = reader.ReadLine(); } scheme.initInString(lists); MainDV.setScheme(scheme); } catch (Exception ex) { MessageBox.Show("该文件损坏"); return; } MainDV.Flash(); } }
private void 管理模式ToolStripMenuItem_Click(object sender, EventArgs e) { //if (haveInAdmin == false) //{ // checkPassword.checkPassword(); // if (checkPassword.passwordRight) // { // MainDV.TeacherMode(); // haveInAdmin = true; // } //} menu.Items[2].Visible = false; //教师端没有进度定义 MainDV.TeacherMode(); MainDV.Flash(); }
private void 修改状态ToolStripMenuItem_Click(object sender, EventArgs e) { codeGet codeform = new codeGet(); codeform.getCode(); string code = codeform.getcode; if (code == null || code == "") { return; } if (MainDV.changeLearnState(VCode.VCodetobit(code)) == false) { MessageBox.Show("该进度代码与当前依赖不匹配,请输入正确的进度代码"); } else { MainDV.Flash(); } }
private void 学习模式ToolStripMenuItem_Click(object sender, EventArgs e) { MainDV.StudentMode(); MainDV.Flash(); menu.Items[2].Visible = true; //学生端有进度管理 }