Пример #1
0
 private void FeedInformationDialog_Load(object sender, EventArgs e)
 {
     chklstbCategories.BeginUpdate();
     chklstbCategories.DataSource    = FeedsContainer.GetCategories().ToList();
     chklstbCategories.DisplayMember = Util.Reflection.GetPropertyName((IRSSCategory cat) => cat.CategoryName);
     for (int i = 0; i < FeedsContainer.CategoriesCount; i++)
     {
         bool belongtocategory = Feed.BelongsToCategories.Contains(FeedsContainer.GetCategoryAt(i));
         chklstbCategories.SetItemChecked(i, belongtocategory);
     }
     chklstbCategories.EndUpdate();
     GetFeedPosts(true);
 }
Пример #2
0
 private void lstbFeedsForCategories_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         IRSSFeed current = lstbFeedsForCategories.SelectedItem as IRSSFeed;
         if (current != null)
         {
             lblFeedForCategories.Text    = "Selected feed: " + current.RSSName;
             chklstbCategories.ItemCheck -= chklstbCategories_ItemCheck;
             chklstbCategories.BeginUpdate();
             for (int i = 0; i < FeedsContainer.CategoriesCount; i++)
             {
                 bool belongtocategory = current.BelongsToCategories.Contains(FeedsContainer.GetCategoryAt(i));
                 chklstbCategories.SetItemChecked(i, belongtocategory);
             }
             chklstbCategories.EndUpdate();
             chklstbCategories.ItemCheck += chklstbCategories_ItemCheck;
         }
     }
 }