Esempio n. 1
0
        private void chklstbCategories_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            IRSSFeed current = lstbFeedsForCategories.SelectedItem as IRSSFeed;

            if (current == null)
            {
                MessageShow.ShowMessage(this,
                                        "Please select feed from the left please before assigning category to a feed.",
                                        "Unable to continue", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (e.Index >= 0)
            {
                if (e.NewValue == CheckState.Checked)
                {
                    IRSSCategory cat = chklstbCategories.SelectedItem as IRSSCategory;
                    if (cat != null)
                    {
                        current.AddToCategory(cat);
                    }
                }
                else if (e.NewValue == CheckState.Unchecked)
                {
                    IRSSCategory cat = chklstbCategories.SelectedItem as IRSSCategory;
                    if (cat != null)
                    {
                        current.RemoveFromCategory(cat);
                    }
                }
            }
        }
Esempio n. 2
0
 public void RemoveFeed(IRSSFeed feed)
 {
     FeedsInCategory.Remove(feed);
     if (feed.BelongsToCategories.Contains(this))
     {
         feed.RemoveFromCategory(this);
     }
 }