private void SetDispalyFeeds(DisplayFeedsType type, IRSSCategory category) { RSSFeedsContainer feeds = FeedsGroup.FirstOrDefault(); if (feeds != null) { switch (type) { case DisplayFeedsType.All: DisplayFeeds = feeds.GetFeeds().Where(feed => !feed.Disabled).ToList(); DisplayFeedsName = "All Feeds"; break; case DisplayFeedsType.Active: DisplayFeeds = (from feed in feeds.GetFeeds() where (feed.Active && !feed.Disabled) select feed).ToList(); DisplayFeedsName = "All Active Feeds"; break; case DisplayFeedsType.NonActive: DisplayFeeds = (from feed in feeds.GetFeeds() where (!feed.Active && !feed.Disabled) select feed).ToList(); DisplayFeedsName = "All Non Active Feeds"; break; case DisplayFeedsType.Privates: DisplayFeeds = feeds.GetFeeds().Where(feed => !feed.Disabled && feed.IsPersonalFeed).ToList(); DisplayFeedsName = "All Private Feeds"; break; case DisplayFeedsType.Disabled: DisplayFeeds = feeds.GetFeeds().Where(feed => feed.Disabled).ToList(); DisplayFeedsName = "All Disabled Feeds"; break; case DisplayFeedsType.NotInCategory: DisplayFeeds = feeds.GetFeeds().Where(feed => !feed.Disabled && feed.BelongsToCategories.Count == 0).ToList (); DisplayFeedsName = "All Feeds not in any Category"; break; case DisplayFeedsType.InSomeCategory: if (category != null) { DisplayFeeds = (from feed in feeds.GetFeeds() where feed.BelongsToCategories.Contains(category) select feed).ToList(); DisplayFeedsName = "All Feeds in Category: " + category.CategoryName; } break; } // tpFeeds.Text = string.Format("Feeds Viewer (Selected Feeds: {0})", DisplayFeedsName); } }
private void txtbTextForSearch_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) { var allMatchedPosts = Search(FeedsGroup.FirstOrDefault(), txtbTextForSearch.Text).ToList(); dgvRSSItems.DataSource = allMatchedPosts; tsslRecords.Text = "Number of records: " + allMatchedPosts.Count; } }
private void txtbTextForSearch_KeyPress(object sender, KeyPressEventArgs e) { //if (e.KeyChar == (char)Keys.Return) //{ var allMatchedPosts = Search(FeedsGroup.FirstOrDefault(), txtbTextForSearch.Text).ToList(); olvPosts.SetObjects(allMatchedPosts); tsslRecords.Text = "Number of records: " + allMatchedPosts.Count; // } }