public void AddToCategory(Category category, Publisher publisher)
 {
     if (this.categories.Keys.Contains(category.Id)) {
         var categoryItem = this.categories[category.Id];
         categoryItem.AddPublisher(publisher);
     }
 }
 public void RemoveCategory(Category category)
 {
     if (this.categories.Keys.Contains(category.Id)) {
         var categoryItem = this.categories[category.Id];
         this.categoryList.Children.Remove(categoryItem);
         this.categories.Remove(category.Id);
     }
 }
 public CategoryItem AddCategory(Category category)
 {
     if (!this.categories.Keys.Contains(category.Id)) {
         var categoryItem = new CategoryItem();
         categoryItem.Category = category;
         categoryItem.SelectedPublisherChanged += new SelectedPublisherChangedEventHandler(category_SelectedPublisherChanged);
         categories.Add(category.Id, categoryItem);
         this.categoryList.Children.Add(categoryItem);
         return categoryItem;
     } else {
         return this.categories[category.Id];
     }
 }
 public override void HandleNotification(INotification notification)
 {
     switch (notification.Name) {
         case ApplicationFacade.CreateCategoryWindow:
             categoryWindow = new CategoryWindow();
             if (categoryWindow.ShowDialog().GetValueOrDefault() == true) {
                 Category category = new Category();
                 category.Name = categoryWindow.CategoryName;
                 Facade.SendNotification(ApplicationFacade.CreateCategory, category);
             }
             break;
         case ApplicationFacade.RenameCategoryWindow:
             categoryWindow = new CategoryWindow();
             categoryWindow.CategoryName = notification.Body as string;
             if (categoryWindow.ShowDialog().GetValueOrDefault() == true)
                 Facade.SendNotification(
                     ApplicationFacade.RenameCategory,
                     new KeyValuePair<string, string>(notification.Body as string, categoryWindow.CategoryName));
             break;
         default:
             break;
     }
 }
 public void SelectCategory(Category category)
 {
     if(this.categoriesCombo.Items.Contains(category))
     this.categoriesCombo.SelectedItem = category;
 }
 public void AddCategory(Category category)
 {
     this.categoriesCombo.Items.Add(category);
 }
예제 #7
0
 public void Store(Category category)
 {
     categoryRepository.Save(category);
 }
 public void RenameCategory(Category category)
 {
     if (this.categories.Keys.Contains(category.Id)) {
         var categoryItem = this.categories[category.Id];
         categoryItem.Category = category;
         categoryItem.SelectedPublisherChanged += new SelectedPublisherChangedEventHandler(category_SelectedPublisherChanged);
     }
 }