private void btnDeleteRSS_Click(object sender, EventArgs e) { int feedindex = chkblstRSSItems.SelectedIndex; if (feedindex >= 0) { string msg = string.Format("How are sure you want to delete the Feed {0}?", FeedsContainer[feedindex].RSSName); var result = MessageShow.ShowMessage(this, msg, "Feed deletion confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { IRSSFeed removedFeed = FeedsContainer[feedindex]; FeedsContainer.DeleteFeed(removedFeed); chkblstRSSItems.Items.RemoveAt(feedindex); LoadFeedsForCategories(); btnDeleteRSS.Enabled = false; txtbUpdateFeedURL.Text = ""; txtbUpdateFeedName.Text = ""; txtbUpdateFeedName.Tag = null; chkbPrivate.Checked = false; OnFeedRemoval(this, new FeedArgs(removedFeed, false)); } } }
private void LoadFeedsForCategories() { lstbFeedsForCategories.DataSource = FeedsContainer.GetFeeds().ToList(); lstbFeedsForCategories.DisplayMember = Util.Reflection.GetPropertyName((IRSSFeed feed) => feed.RSSName); lstbFeedsForCategories.SelectedItem = null; lblFeedForCategories.Text = "Selected: "; }
private void SaveFeeds(IRSSFeed newFeed) { FeedsContainer.AddFeed(newFeed); chkblstRSSItems.Items.Add(newFeed.RSSName, newFeed.Active); OnNewFeedAdded(this, new FeedArgs(newFeed, true)); FeedsContainer.SerializeToBinaryFile(Settings.AppRSSSetings.FileName); LoadFeedsForCategories(); }
private void ClearHistories() { int i = 0; foreach (IRSSFeed feed in FeedsContainer.GetFeeds()) { feed.ClearFeedPosts(); } }
private void btnCategoriesAdd_Click(object sender, EventArgs e) { if (!txtbNewCategoryName.Text.Equals(string.Empty)) { IRSSCategory newcat = new RSSCategory(txtbNewCategoryName.Text); FeedsContainer.AddCategory(newcat); LoadCategories(); OnCategoriesChanged(this, new Args()); } }
private void SelectDeselectAllFeeds(bool markAllSelected) { int i = 0; foreach (IRSSFeed feed in FeedsContainer.GetFeeds()) { feed.Active = markAllSelected; chkblstRSSItems.SetItemChecked(i++, markAllSelected); } }
private void btnCategoriesDelete_Click(object sender, EventArgs e) { IRSSCategory cat = chklstbCategories.SelectedItem as IRSSCategory; if (cat != null) { FeedsContainer.RemoveCategory(cat); LoadCategories(); OnCategoriesChanged(this, new Args()); } }
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); }
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; } } }
private void LoadCategories() { chklstbCategories.DataSource = FeedsContainer.GetCategories().ToList(); chklstbCategories.DisplayMember = Util.Reflection.GetPropertyName((IRSSCategory cat) => cat.CategoryName); }
private void SettingsDialog_FormClosing(object sender, FormClosingEventArgs e) { SaveSettings(false); FeedsContainer.SerializeToBinaryFile(Settings.AppRSSSetings.FileName); }