public virtual void SetAnsuer() { string s_Ansuer = MTControler.GetAdrees(_LstAnsuer, false); string s_Response = _objPatch.Adrees; _dtDate = DateTime.Now; MTStructTest strTest; strTest.Date = this.Date; strTest.Type = this.Type; if (s_Ansuer == s_Response) { WasCorrect = true; strTest.WasCorrect = true; _objPatch.lstTest.Add(strTest); MTClassificator.UpdatePatch(_objPatch); } else { WasCorrect = false; strTest.WasCorrect = false; _objPatch.lstTest.Add(strTest); MTClassificator.UpdateAllPositions(); } MTParser.WritePatch(_objPatch); MTParser.WriteDataTest(_objPatch, this); }
public void AddApply() { LstApply.Add("Nova Aplicação."); SelIndex = LstApply.Count() - 1; FirePropertyChanged("DocBlank"); FirePropertyChanged("TextIsEnabled"); MTParser.WritePatch(_objPatch); }
public void RemoveSelectedApply() { if (LstApply.Count() >= 1) { LstApply.RemoveAt(SelIndex); if (SelIndex > (LstApply.Count() - 1)) { SelIndex = (SelIndex - 1); } else { SelIndex = (LstApply.Count() - 1); } FirePropertyChanged("DocBlank"); FirePropertyChanged("TextIsEnabled"); MTParser.WritePatch(_objPatch); } }
private void cbEnabled_Unchecked(object sender, RoutedEventArgs e) { CloseCurrentPopup(); CheckBox objCb = sender as CheckBox; if (!lvTexts.SelectedItems.Contains(objCb.DataContext)) { MTParser.WritePatch(objCb.DataContext as MTPatchModel); } else { foreach (MTPatchModel objPatch in lvTexts.SelectedItems) { objPatch.TestIsEnabled = false; MTParser.WritePatch(objPatch); } } MTControler.TextManager.FirePropertyChanged("DgCollection"); }
private void btAdd_Click(object sender, RoutedEventArgs e) { var obj = MTControler.TextManager.LstPatch.Where(x => x.Adrees == _Map.GetAdrees()); if (obj.Count() != 0) { MessageBox.Show(string.Format("O texto {0} já existe.", _objText.Adrees), "Texto existente", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } if (!_bIsAdd) { MTControler.TextManager.LstPatch.Remove(_objText); } _objText.SetLstAdress(_Map.SelectedPatch); MTControler.TextManager.AddPatch(_objText); MTParser.WritePatch(_objText); this.Close(); }