Ejemplo n.º 1
0
 public void SaveOriginalWordDescription()
 {
     if (SelectedOriginalWord != null)
     {
         Description description;
         if (tradicIterator.GetDescriptions().ToList().Exists(d => d.WordId == SelectedOriginalWord.Id))
         {
             description      = tradicIterator.GetDescriptions().First(d => d.WordId == SelectedOriginalWord.Id);
             description.Text = OriginalWordDescription;
             tradicIterator.ChangeEntity(description);
             Descriptions.First(d => d.WordId == SelectedOriginalWord.Id).Text = OriginalWordDescription;
         }
         else
         {
             description = new Description {
                 WordId = SelectedOriginalWord.Id, Text = OriginalWordDescription
             };
             tradicIterator.AddEntity(description);
             Descriptions.Add(tradicIterator.GetDescriptions().Last());
         }
     }
     else
     {
         MessageBox.Show("You must choose original word", "Choose warning", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Ejemplo n.º 2
0
 protected override void InitializeFields()
 {
     tradicIterator    = TradicIterator.GetInstance();
     Words             = new ObservableCollection <Word>(tradicIterator.GetWords());
     Descriptions      = new ObservableCollection <Description>(tradicIterator.GetDescriptions());
     OriginalLanguages = new ObservableCollection <Language>(tradicIterator.GetLanguages());
 }
Ejemplo n.º 3
0
 public EqualExam(ITradicIterator entitiesIterator)
 {
     this.entitiesIterator = entitiesIterator;
     descriptions          = entitiesIterator.GetDescriptions();
     languages             = entitiesIterator.GetLanguages();
     SortAllWords();
 }