Exemplo n.º 1
0
 private void NextTest(bool skipped) {
     if (!pnTestInfo.Visible) pnTestInfo.Visible = true;
     if (currentTestIndex >= 0) {
         if (skipped) {
             gramTestResult.TestSkippedCount = gramTestResult.TestSkippedCount + 1;
         } else {
             if (!DocumentHelpers.AlmostCorrectPieces(currentPieces, checkPieces)) {
                 gramTestResult.MistakeCount = gramTestResult.MistakeCount + 1;
                 XtraMessageBox.Show(this, "Элементы текста выделены неверно. Попробуйте еще раз.", Grammatica2._0.Properties.Resources.Grammarica20, MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             } else {
                 XtraMessageBox.Show(this, "Верно.", Grammatica2._0.Properties.Resources.Grammarica20, MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     currentPieces.Clear();
     currentTestIndex++;
     if (currentGramText == null || currentTestIndex >= currentGramText.Tests.Count) {
         currentTextIndex++;
         if (currentTextIndex >= gramTextList.Count) {
             AllComplete();
             return;
         }
         currentGramText = gramTextList[currentTextIndex];
         currentTestIndex = 0;
         Text = currentGramText.Title;
         richEdit.RtfText = currentGramText.Text;
     }
     GramTest test = currentGramText.Tests[currentTestIndex];
     meQuestion.Text = test.Question;
     promtText = test.Promt;
     sbPromt.Visible = !string.IsNullOrEmpty(promtText);
     checkPieces = test.Pieces;
     DocumentHelpers.UpdateDocumentPieces(richEdit, currentPieces);
 }
Exemplo n.º 2
0
 public TextEditForm(Guid oid) {
     InitializeComponent();
     uow = new UnitOfWork();
     if (oid == Guid.Empty) {
         gramText = new GramText(uow);
     } else {
         gramText = uow.GetObjectByKey<GramText>(oid);
     }
     LoadGramText();
 }