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"; }
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; } }
private void dgvRSSItems_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (dgvRSSItems.CurrentRow != null) { IRSSPost itm = dgvRSSItems.CurrentRow.DataBoundItem as IRSSPost; OnRSSItemChanged(this, new RSSArgs(itm)); } }
private void dgvRSSItems_SelectionChanged(object sender, EventArgs e) { if (Visible && dgvRSSItems.CurrentRow != null) { IRSSPost currentitem = (IRSSPost)dgvRSSItems.CurrentRow.DataBoundItem; LoadItemInViewer(currentitem); } }
private void chkbHistory_Click(object sender, EventArgs e) { if (dgvRSSPosts.CurrentRow != null) { IRSSPost currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem; currentitem.IgnorePostContentIncomparison = !currentitem.IgnorePostContentIncomparison; dgvRSSPosts.Refresh(); } }
private void btnHide_Click(object sender, EventArgs e) { if (dgvRSSPosts.CurrentRow != null) { IRSSPost currentitem = (IRSSPost)dgvRSSPosts.CurrentRow.DataBoundItem; currentitem.IgnoreThisPost = !currentitem.IgnoreThisPost; dgvRSSPosts.Refresh(); } }
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; } }
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; }
private void olvPosts_SelectedIndexChanged(object sender, EventArgs e) { if (olvPosts.SelectedObject != null) { IRSSPost currentitem = olvPosts.SelectedObject as IRSSPost; if (currentitem != null) { LoadItemInViewer(currentitem); } } }
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); } } }
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)); } } }
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)); } } }
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); } } }
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)); } } }
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(); } }
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 }); }
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; } } }
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); } } }
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); } } }
public RSSPostArgs(IRSSPost post) { Post = post; }
public RSSArgs(IRSSPost rssitem) { this.Post = rssitem; }