Esempio n. 1
0
        private void LoadItemInViewer(IRSSPost post)
        {
            webbPostViewer.Navigating -= webbPostViewer_Navigating;
            string link = string.Empty;

            if (!string.IsNullOrEmpty(post.Link))
            {
                link = string.Format("<a href=\"{0}\">Link</a>", post.Link);
            }



            if (string.IsNullOrEmpty(post.Description) && string.IsNullOrEmpty(post.Content))
            {
                webbPostViewer.DocumentText = post.Title;
            }
            else
            {
                webbPostViewer.DocumentText = link + " <br>" + post.Description + "<br>" + post.Content;
            }

            tsbtnCheckAsRead.Tag    = post;
            tsbntHideShowPost.Image = (post.IgnoreThisPost) ? Properties.Resources.buttonOFF : Properties.Resources.buttonOn;
            tsbntHideShowPost.Text  = (post.IgnoreThisPost) ? "Restore post visibility " : "Hide post On Main Screen";
        }
Esempio n. 2
0
        private void LoadItemInViewer(IRSSPost post)
        {
            //if (chkbWhenToMarkAsRead.Checked)
            //{
            //    post.Read = true;
            //    UpdateFeedsCountsAfterChange();
            //}

            dgvRSSItems.Refresh();
            webbPostViewer.Navigating -= webbPostViewer_Navigating;
            string link = string.Empty;

            if (!string.IsNullOrEmpty(post.Link))
            {
                link = string.Format("<a href=\"{0}\">Link</a>", post.Link);
            }

            lblbPostTitle.Text = "Post: " + post.Title;

            if (string.IsNullOrEmpty(post.Description) && string.IsNullOrEmpty(post.Content))
            {
                webbPostViewer.DocumentText = post.Title;
                rtxtbSource.Text            = post.Title;
            }
            else
            {
                webbPostViewer.DocumentText = link + " <br>" + post.Description + "<br>" + post.Content;
                rtxtbSource.Text            = link + " <br>" + post.Description + "<br>" + post.Content;
            }
        }
Esempio n. 3
0
 private void dgvRSSItems_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvRSSItems.CurrentRow != null)
     {
         IRSSPost itm = dgvRSSItems.CurrentRow.DataBoundItem as IRSSPost;
         OnRSSItemChanged(this, new RSSArgs(itm));
     }
 }
Esempio n. 4
0
 private void dgvRSSItems_SelectionChanged(object sender, EventArgs e)
 {
     if (Visible && dgvRSSItems.CurrentRow != null)
     {
         IRSSPost currentitem = (IRSSPost)dgvRSSItems.CurrentRow.DataBoundItem;
         LoadItemInViewer(currentitem);
     }
 }
Esempio n. 5
0
 private void chkbHistory_Click(object sender, EventArgs e)
 {
     if (dgvRSSPosts.CurrentRow != null)
     {
         IRSSPost currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem;
         currentitem.IgnorePostContentIncomparison = !currentitem.IgnorePostContentIncomparison;
         dgvRSSPosts.Refresh();
     }
 }
Esempio n. 6
0
 private void btnHide_Click(object sender, EventArgs e)
 {
     if (dgvRSSPosts.CurrentRow != null)
     {
         IRSSPost currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem;
         currentitem.IgnoreThisPost = !currentitem.IgnoreThisPost;
         dgvRSSPosts.Refresh();
     }
 }
Esempio n. 7
0
 private void dgvRSSPosts_Click(object sender, EventArgs e)
 {
     if (dgvRSSPosts.CurrentRow != null)
     {
         IRSSPost currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem;
         gbSelectedPost.Text = "Selected Post: " + currentitem.Title;
         chkbHistory.Checked = currentitem.IgnorePostContentIncomparison;
     }
 }
Esempio n. 8
0
 private void btnToggleState_Click(object sender, EventArgs e)
 {
     if (olvPosts.Objects != null)
     {
         IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
         currentitem.FollowUp = !currentitem.FollowUp;
         olvPosts.RefreshObject(currentitem);
     }
 }
        public RSSItemViewer(IRSSPost thePost)
        {
            InitializeComponent();

            Post = thePost;
            var cancelButton = new Button();

            cancelButton.Click += ((s, e) => this.BeginInvoke((MethodInvoker)this.Close));
            CancelButton        = cancelButton;
        }
Esempio n. 10
0
 private void olvPosts_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (olvPosts.SelectedObject != null)
     {
         IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
         if (currentitem != null)
         {
             LoadItemInViewer(currentitem);
         }
     }
 }
Esempio n. 11
0
 private void olvPosts_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (olvPosts.SelectedObject != null && (e.KeyChar == (char)Keys.Space))
     {
         IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
         if (currentitem != null)
         {
             currentitem.Read = !currentitem.Read;
             olvPosts.RefreshObject(currentitem);
         }
     }
 }
Esempio n. 12
0
 private void chkbHistory_Click(object sender, EventArgs e)
 {
     if (olvPosts.SelectedObject != null)
     {
         IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
         if (currentitem != null)
         {
             currentitem.IgnorePostContentIncomparison = !currentitem.IgnorePostContentIncomparison;
             OnPostChanged(this, new RSSArgs(currentitem));
         }
     }
 }
Esempio n. 13
0
 private void btnHide_Click(object sender, EventArgs e)
 {
     if (olvPosts.SelectedObject != null)
     {
         IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
         if (currentitem != null)
         {
             currentitem.IgnoreThisPost = !currentitem.IgnoreThisPost;
             OnPostChanged(this, new RSSArgs(currentitem));
         }
     }
 }
Esempio n. 14
0
        public void RemovePost(IRSSPost post)
        {
            var itemsComparer = new FullRSSPostComparer();

            if (RSSItemsList.Contains(post, itemsComparer))
            {
                int pos = RSSItemsList.FindIndex(item => itemsComparer.Equals(item, post));
                if (pos >= 0)
                {
                    RSSItemsList.RemoveAt(pos);
                }
            }
        }
Esempio n. 15
0
 private void olvPosts_Click(object sender, EventArgs e)
 {
     if (olvPosts.SelectedObject != null)
     {
         IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
         if (currentitem != null)
         {
             gbSelectedPost.Text = "Selected Post: " + currentitem.Title;
             chkbHistory.Checked = currentitem.IgnorePostContentIncomparison;
             OnPostChanged(this, new RSSArgs(currentitem));
         }
     }
 }
Esempio n. 16
0
        private void dgvRSSPosts_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvRSSPosts.CurrentRow != null)
            {
                IRSSPost currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem;
                var      rssDisplay  = new RSSItemViewer(currentitem);
                rssDisplay.OnRSSItemChanged += delegate { dgvRSSPosts.Refresh(); };

                rssDisplay.Show();
                currentitem.Read = true;
                dgvRSSPosts.Refresh();
            }
        }
Esempio n. 17
0
 private AnalogyLogMessage CreateAnalogyMessageFromPost(IRSSPost post)
 {
     return(new AnalogyLogMessage
     {
         Category = post.FeedName,
         Class = AnalogyLogClass.General,
         Date = post.Date ?? DateTime.MinValue,
         FileName = post.FeedName,
         Level = AnalogyLogLevel.Information,
         Source = post.Url,
         Text = post.Title + Environment.NewLine + post.Description
     });
 }
Esempio n. 18
0
        private void olvPosts_DoubleClick(object sender, EventArgs e)
        {
            if (olvPosts.SelectedObject != null)
            {
                IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost;
                if (currentitem != null)
                {
                    var rssDisplay = new RSSItemViewer(currentitem);
                    rssDisplay.OnRSSItemChanged += (s2, e2) => olvPosts.RefreshObject(e2.Post);

                    rssDisplay.Show();
                    currentitem.Read = true;
                }
            }
        }
Esempio n. 19
0
        private void tsbtnCheckAsRead_Click(object sender, EventArgs e)
        {
            IRSSPost post = tsbtnCheckAsRead.Tag as IRSSPost;

            if (post != null)
            {
                post.Read = true;
                if (olvPosts != null && Settings.AppGUISettings.RemovePostFromListAfterRead)
                {
                    olvPosts.RemoveObject(post);
                }
                else
                {
                    olvPosts.RefreshObject(post);
                }
            }
        }
Esempio n. 20
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (dgvRSSPosts.CurrentRow != null)
     {
         IRSSPost     currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem;
         DialogResult result      = MessageShow.ShowMessage(this,
                                                            "Are you sure you want to delete the selected post?",
                                                            "Post Deletion confirmation",
                                                            MessageBoxButtons.YesNo,
                                                            MessageBoxIcon.
                                                            Exclamation);
         if (result == DialogResult.Yes)
         {
             currentitem.DeleteThisPost();
             GetFeedPosts(chkbShowHiddenPosts.Checked);
         }
     }
 }
Esempio n. 21
0
 public RSSPostArgs(IRSSPost post)
 {
     Post = post;
 }
Esempio n. 22
0
 public RSSArgs(IRSSPost rssitem)
 {
     this.Post = rssitem;
 }