public void ShowAnsuerPopup(MTTestModel objTest) { if (objTest.WasCorrect == null) { MTMapUser ansuerUser = CurrentAsuerPopup.FindName("_Map") as MTMapUser; //Set Map stage if (objTest.Patch.Score < MTControler.Settings.Stg1to2) { MTLibraryModel.Stage = TestStage.Stage_1; } else if (objTest.Patch.Score < MTControler.Settings.Stg2to3) { MTLibraryModel.Stage = TestStage.Stage_2; } else { MTLibraryModel.Stage = TestStage.Stage_3; } ansuerUser.MapMode = objTest.Type; ansuerUser.Action = new DoSomeThing(objTest.Action); Grid objGrid = UtilsTools.GetChild(lbTest, lbTest.SelectedIndex, "GridTest") as Grid; CurrentAsuerPopup.PlacementTarget = objGrid; foreach (MTMapModel objMap in ansuerUser.lvMap.Items) { objMap.FirePropertyChanged("Color"); } CurrentAsuerPopup.IsOpen = true; switch (ansuerUser.MapMode) { case TestType.AskAdrees: ansuerUser.SetSelectedVersesList(objTest.LstAnsuer); ansuerUser.tbTextAdres.Text = (objTest as MTTestAskAdreesModel).PreviosText; if (MTLibraryModel.Stage == TestStage.Stage_3) { ansuerUser.tbTextAdres.Focus(); } else { ansuerUser.lvMap.Focus(); } break; case TestType.AskText: ansuerUser.tbSearch.Text = (objTest as MTTestAskTextModel).Fragment; ansuerUser.tbSearch.Focus(); break; } } }
public override void InitializeRichTextBox() { ListView lvTest = MTControler.DlgTest.lbTest; RichTextBox objRtbox = UtilsTools.GetChild(lvTest, lvTest.Items.IndexOf(this), "rtbText") as RichTextBox; if (objRtbox == null) { return; } objRtbox.Document.Blocks.Clear(); objRtbox.Document.Blocks.Add(GetParagAsk()); }
public override void Action(MTMapUser ansuerUser) { _LstAnsuer = ansuerUser.SelectedPatchClone; _sFragment = ansuerUser.tbSearch.Text; string sText = MTControler.GetAdrees(ansuerUser.SelectedPatch, false); AnsuerToShow = (sText == "" ? _sAnsuer : sText); ListView lvTest = MTControler.DlgTest.lbTest; RichTextBox objRtbox = UtilsTools.GetChild(lvTest, lvTest.Items.IndexOf(this), "rtbText") as RichTextBox; objRtbox.Document.Blocks.Clear(); objRtbox.Document.Blocks.Add(GetParagAsk()); objRtbox.Document.Blocks.Add(GetSearchedText()); }
public override void InitializeRichTextBox() { ListView lvTest = MTControler.DlgTest.lbTest; RichTextBox objRtbox = UtilsTools.GetChild(lvTest, lvTest.Items.IndexOf(this), "rtbText") as RichTextBox; if (objRtbox != null) { objRtbox.Document.Blocks.Clear(); if (Patch.Score < MTControler.Settings.Stg2to3) { objRtbox.Document.Blocks.Add(GetParagAsk("#")); } else { objRtbox.Document.Blocks.Add(GetParagAsk("")); } } }