void AddLesson() { LessonDialog dialog = new LessonDialog(host.CurrentTheme); Lesson lesson = dialog.CreateObject(this); if (lesson != null) { AddLessonNode(lesson); treeLessons.Nodes[0].Expand(); } }
void ButtonEditClick(object sender, EventArgs e) { Lesson lesson = CurrentLesson; if (lesson != null) { LessonDialog dialog = new LessonDialog(host.CurrentTheme); lesson = dialog.Edit(this, lesson); if (lesson != null) { treeLessons.SelectedNode.Tag = lesson; treeLessons.SelectedNode.Text = lesson.Name; } } }