private void import(string filename) { try { XmlDataDocument xml_doc = new XmlDataDocument(); xml_doc.Load(filename); var lessonNodes = xml_doc.SelectNodes("//lesson"); foreach (XmlNode ln in lessonNodes) { int id = Convert.ToInt32(getAttributeOrDefault(ln, "id", "-1")); string description = getAttributeOrDefault(ln, "description", "No description set"); var lesson = new LessonNode(id, description); var pairNodes = ln.SelectNodes("pair"); foreach (XmlNode pn in pairNodes) { lesson.PairStore.AddNode(new PairNode(SelectTextNode(pn, "en"), SelectTextNode(pn, "de"))); } LessonStore.AddNode(lesson); } } catch (FileNotFoundException) { } }
public LessonView(LessonNode lesson) { Build (); this.lesson = lesson; this.Name = lesson.Description; nodeview2.NodeStore = lesson.PairStore; nodeview2.AppendColumn ("en", new Gtk.CellRendererText (), "text", 0); nodeview2.AppendColumn ("de", new Gtk.CellRendererText (), "text", 1); for(int i = 0; i< 2; i++ ) { nodeview2.Columns[i].Resizable=true; } entry3.Text = lesson.Description; ShowAll (); CanEditRemove = false; }
protected virtual void OnAddActionActivated(object sender, System.EventArgs e) { var lesson = new LessonNode (0, "New Lesson"); var dlg = new EditLessonDialog (); dlg.Id = lesson.Id; dlg.Description = lesson.Description; if (dlg.Run () == (int)ResponseType.Ok) { lesson.Id = dlg.Id; lesson.Description = dlg.Description; nodeview3.NodeStore.AddNode (lesson); } dlg.Destroy (); }
public LessonView(LessonNode lesson) { Build(); this.lesson = lesson; this.Name = lesson.Description; nodeview2.NodeStore = lesson.PairStore; nodeview2.AppendColumn("en", new Gtk.CellRendererText(), "text", 0); nodeview2.AppendColumn("de", new Gtk.CellRendererText(), "text", 1); for (int i = 0; i < 2; i++) { nodeview2.Columns[i].Resizable = true; } entry3.Text = lesson.Description; ShowAll(); CanEditRemove = false; }
public SimpleAssessmentWidget(LessonNode lesson) { this.Build (); this.lesson = lesson; buttonCount = min(5, lesson.PairCount); submitButtons = new Button[buttonCount]; for (int i = 0; i < buttonCount; i++) { var b = new Button(); vbuttonbox1.Add(b); b.Clicked += submit; submitButtons[i] = b; } newTest(); }
protected virtual void OnAddActionActivated(object sender, System.EventArgs e) { var lesson = new LessonNode(0, "New Lesson"); var dlg = new EditLessonDialog(); dlg.Id = lesson.Id; dlg.Description = lesson.Description; if (dlg.Run() == (int)ResponseType.Ok) { lesson.Id = dlg.Id; lesson.Description = dlg.Description; nodeview3.NodeStore.AddNode(lesson); } dlg.Destroy(); }
public SimpleAssessmentWidget(LessonNode lesson) { this.Build(); this.lesson = lesson; buttonCount = min(5, lesson.PairCount); submitButtons = new Button[buttonCount]; for (int i = 0; i < buttonCount; i++) { var b = new Button(); vbuttonbox1.Add(b); b.Clicked += submit; submitButtons[i] = b; } newTest(); }
protected virtual void OnEditActionActivated(object sender, System.EventArgs e) { LessonNode lesson = (LessonNode)nodeview3.NodeSelection.SelectedNode; openLesson.Invoke(this, new OpenLessonEventArgs(lesson)); }
public StartAssessmentEventArgs(LessonNode lesson) { this.lesson = lesson; }
public OpenLessonEventArgs(LessonNode n) { Node = n; }
private void import(string filename) { try { XmlDataDocument xml_doc = new XmlDataDocument (); xml_doc.Load (filename); var lessonNodes = xml_doc.SelectNodes ("//lesson"); foreach (XmlNode ln in lessonNodes) { int id = Convert.ToInt32 (getAttributeOrDefault (ln, "id", "-1")); string description = getAttributeOrDefault (ln, "description", "No description set"); var lesson = new LessonNode (id, description); var pairNodes = ln.SelectNodes ("pair"); foreach (XmlNode pn in pairNodes) { lesson.PairStore.AddNode (new PairNode (SelectTextNode (pn, "en"), SelectTextNode (pn, "de"))); } LessonStore.AddNode (lesson); } } catch (FileNotFoundException) { } }