Ejemplo n.º 1
0
 private void RenameCategoryCommandExecuted()
 {
     Category category = (Category) AuthorsListBox.SelectedValue;
     if (category == null) return;
     RenameWindow rw = new RenameWindow(category);
     if (rw.ShowDialog() == true)
     {
         InfoUpdater.BeginUpdate();
         try
         {
             foreach (Author author in InfoUpdater.Authors)
             {
                 if (author.Category == category.Name)
                     author.Category = rw.ResultNewName;
             }
             category.Name = rw.ResultNewName;
         }
         finally
         {
             InfoUpdater.EndUpdate();
         }
     }
     InfoUpdater.Refresh();
     AuthorsListBox.ScrollIntoView(category);
     InfoUpdater.Save();
 }
Ejemplo n.º 2
0
 private void NewCategoryMenuClick(object sender, RoutedEventArgs e)
 {
     Author author = (Author) AuthorsListBox.SelectedValue;
     RenameWindow rw = new RenameWindow();
     if (rw.ShowDialog() == true)
     {
         if (rw.ResultNewName.Trim() == "") return;
         author.Category = rw.ResultNewName;
     }
     AuthorsListBox.ScrollIntoView(author);
     InfoUpdater.Save();
 }
Ejemplo n.º 3
0
 private void RenameAuthorCommandExecuted()
 {
     Author author = (Author) AuthorsListBox.SelectedValue;
     if (author == null) return;
     RenameWindow rw = new RenameWindow(author);
     if (rw.ShowDialog() == true)
         author.Name = rw.ResultNewName;
     AuthorsListBox.ScrollIntoView(author);
     InfoUpdater.Save();
 }