Example #1
0
        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));
                }
            }
        }
Example #2
0
 private void LoadFeedsForCategories()
 {
     lstbFeedsForCategories.DataSource    = FeedsContainer.GetFeeds().ToList();
     lstbFeedsForCategories.DisplayMember = Util.Reflection.GetPropertyName((IRSSFeed feed) => feed.RSSName);
     lstbFeedsForCategories.SelectedItem  = null;
     lblFeedForCategories.Text            = "Selected: ";
 }
Example #3
0
 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();
 }
Example #4
0
        private void ClearHistories()
        {
            int i = 0;

            foreach (IRSSFeed feed in FeedsContainer.GetFeeds())
            {
                feed.ClearFeedPosts();
            }
        }
Example #5
0
 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());
     }
 }
Example #6
0
        private void SelectDeselectAllFeeds(bool markAllSelected)
        {
            int i = 0;

            foreach (IRSSFeed feed in FeedsContainer.GetFeeds())
            {
                feed.Active = markAllSelected;
                chkblstRSSItems.SetItemChecked(i++, markAllSelected);
            }
        }
Example #7
0
        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());
            }
        }
Example #8
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);
 }
Example #9
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;
         }
     }
 }
Example #10
0
 private void LoadCategories()
 {
     chklstbCategories.DataSource    = FeedsContainer.GetCategories().ToList();
     chklstbCategories.DisplayMember = Util.Reflection.GetPropertyName((IRSSCategory cat) => cat.CategoryName);
 }
Example #11
0
 private void SettingsDialog_FormClosing(object sender, FormClosingEventArgs e)
 {
     SaveSettings(false);
     FeedsContainer.SerializeToBinaryFile(Settings.AppRSSSetings.FileName);
 }