protected void AuthorNameEnter(object sender, EventArgs e) { var dlgGetAuthorName = new OneStringAskDlg("Введите имя автора теста"); dlgGetAuthorName.Modal = true; dlgGetAuthorName.Value = test.Author; if (dlgGetAuthorName.Run() == (int)ResponseType.Ok) { var author = dlgGetAuthorName.Value; if (author.Length > 0) { test.Author = author; } } dlgGetAuthorName.Destroy(); UpdateInfoWidgets(); }
//-----MENU----- protected void TestNameEnter(object sender, EventArgs e) { var dlgGetTestName = new OneStringAskDlg("Введите название теста"); dlgGetTestName.Modal = true; dlgGetTestName.Value = test.Name; if (dlgGetTestName.Run() == (int)ResponseType.Ok) { var testName = dlgGetTestName.Value; if (testName.Length > 0) { test.Name = dlgGetTestName.Value; } } dlgGetTestName.Destroy(); UpdateInfoWidgets(); }
protected void AddAnswerClick(object sender, EventArgs e) { TreeIter iter; QuestionEditArea.Selection.GetSelected(out iter); var question = testQuestions.GetValue(iter, 0) as TestQuestion; if (question == null) { return; } var dlgAddAnswer = new OneStringAskDlg("Новый ответ", true, "Верный ответ"); dlgAddAnswer.Modal = true; if (dlgAddAnswer.Run() == (int)ResponseType.Ok) { var newAnswer = new TestAnswer(dlgAddAnswer.Value, dlgAddAnswer.IsChecked); question.Answers.Add(newAnswer); testAnswers.AppendValues(newAnswer); } dlgAddAnswer.Destroy(); }