Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

RSS Feed Aggregator and Blogging Smart Client

, 16 Aug 2005
RSS Feed aggregator and blogging Smart Client which uses Enterprise Library, Updater Application Block, lots of XML hacks and desktop tricks. A comprehensive guide to real life hurdles of Smart Client development.
rssfeeder_src.zip
RSSFeeder
RSSBlogAPI
RSSBlogAPI.csproj.user
Web References
CommunityServer
blogservice.disco
blogservice.wsdl
Reference.map
DotText
Reference.map
simpleblogservice.disco
simpleblogservice.wsdl
RSSCommon
Helper
PropertyEditor
RSSCommon.csproj.user
RSSFeeder
Controls
docs
dropshadow.png
My Pic 7.jpg
WIndows98.jpg
Helpers
Resources
E-mail.ico
rss.ico
RSSFeeder.mdb
RSSFeeder.csproj.user
RSSStarter.exe
RSSFeederResources
PublicQueue.ico
RSSFeeder.mdb
RSSFeederResources.csproj.user
RSSFeederSetup
Messages.ico
RSSFeederSetup.vdproj
Test
RSSStarter
DummyForm.frm
DummyForm.frx
MainModule.bas
RSSStarter.exe
RSSStarter.vbp
RSSStarter.vbw
RSSTests
App.ico
RSSTests.csproj.user
Thirdparty
AxInterop.DHTMLEDLib.dll
AxInterop.SHDocVw.dll
Eyefinder.dll
GotDotNet.Exslt.dll
HttpDownloader.dll
Interop.DHTMLEDLib.dll
Interop.SHDocVw.dll
Interop.WindowsInstaller.dll
Microsoft.ApplicationBlocks.Updater.ActivationProcessors.dll
Microsoft.ApplicationBlocks.Updater.dll
Microsoft.ApplicationBlocks.Updater.Downloaders.dll
Microsoft.Practices.EnterpriseLibrary.Caching.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Security.Cache.CachingStore.dll
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll
Microsoft.Practices.EnterpriseLibrary.Security.dll
NotifyIconBalloon.dll
SandBar.dll
SandDock.dll
SgmlReaderDll.dll
// Copyright � 2005 by Omar Al Zabir. All rights are reserved.
// 
// If you like this code then feel free to go ahead and use it.
// The only thing I ask is that you don't remove or alter my copyright notice.
//
// Your use of this software is entirely at your own risk. I make no claims or
// warrantees about the reliability or fitness of this code for any particular purpose.
// If you make changes or additions to this code please mark your code as being yours.
// 
// website http://www.oazabir.com, email OmarAlZabir@gmail.com, msn oazabir@hotmail.com

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
namespace RSSFeeder
{
	using RSSCommon;
	using Helpers;
	/// <summary>
	/// Summary description for ErrorReportForm.
	/// </summary>
	public class ErrorReportForm : System.Windows.Forms.Form
	{
		#region Designer

		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox errorReportTextBox;
		private System.Windows.Forms.Timer errorReportTimer;
		private System.ComponentModel.IContainer components;

		public ErrorReportForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ErrorReportForm));
			this.label2 = new System.Windows.Forms.Label();
			this.errorReportTextBox = new System.Windows.Forms.TextBox();
			this.errorReportTimer = new System.Windows.Forms.Timer(this.components);
			this.SuspendLayout();
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 0);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(384, 40);
			this.label2.TabIndex = 1;
			this.label2.Text = "I have encountered some problem. I am now sending an error report to my boss for " +
				"fixing it. Do not worry, it does not contain any personal information. Just exce" +
				"ption dump. I will close automatically";
			// 
			// errorReportTextBox
			// 
			this.errorReportTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.errorReportTextBox.Location = new System.Drawing.Point(8, 48);
			this.errorReportTextBox.Multiline = true;
			this.errorReportTextBox.Name = "errorReportTextBox";
			this.errorReportTextBox.Size = new System.Drawing.Size(384, 48);
			this.errorReportTextBox.TabIndex = 2;
			this.errorReportTextBox.Text = "Error Message being sent...";
			// 
			// errorReportTimer
			// 
			this.errorReportTimer.Interval = 1000;
			this.errorReportTimer.Tick += new System.EventHandler(this.errorReportTimer_Tick);
			// 
			// ErrorReportForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
			this.ClientSize = new System.Drawing.Size(400, 104);
			this.Controls.Add(this.errorReportTextBox);
			this.Controls.Add(this.label2);
			this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "ErrorReportForm";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
			this.Text = "Sending Error Report...";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.ErrorReportForm_Closing);
			this.ResumeLayout(false);

		}
		#endregion

		#endregion

		#region Fields

		private static ErrorReportForm _Instance;		
		private static IList _ErrorReports = new ArrayList();

		private bool _IsErrorBeingSent = false;

		#endregion

		#region Public Methods

		public static void Shutdown()
		{
			if( null != _Instance )
			{
				_Instance.Close();
				_Instance = null;
			}
		}

		public static void QueueErrorReport( ErrorReportItem item )
		{
			_ErrorReports.Add( item );
		}

		public static void SendErrorReport( )
		{
			if( 0 == _ErrorReports.Count ) return;

			if( null == _Instance )
			{
				_Instance = new ErrorReportForm();
				UIHelper.PositionForm( _Instance, Configuration.Instance.PopupWindowPosition );
			}

			_Instance.errorReportTimer.Start();
		}

		#endregion

		#region Private Methods

		private void errorReportTimer_Tick(object sender, System.EventArgs e)
		{
			if( base.Disposing ) return;

			// If not reports in queue, close
			if( 0 == _ErrorReports.Count )
			{
				this.errorReportTimer.Stop();
				_Instance = null;
				base.Close();
			}
			else
			{
				if( !this._IsErrorBeingSent )
				{
					this._IsErrorBeingSent = true;

					base.Show();
					base.Refresh();

					// Get the first error report item
					ErrorReportItem item = _ErrorReports[0] as ErrorReportItem;
					_Instance.errorReportTextBox.Text = item.Details;

					ThreadPool.QueueUserWorkItem( new WaitCallback( SendQueuedReport ), item );	
				}
			}
		}

		private void SendQueuedReport(object state)
		{
			if( base.Disposing ) return;

			ErrorReportItem item = state as ErrorReportItem;
			try
			{
				// Send the report
				ErrorReportHelper.PostTrackerItem( item.Summary, item.Details );			
			}
			catch
			{
				// Who cares
			}

			lock( _ErrorReports )
			{
				_ErrorReports.Remove( state );
			}

			this._IsErrorBeingSent = false;
		}

		private void ErrorReportForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			this.errorReportTimer.Stop();
			_Instance = null;
		}

		#endregion
	}

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


| Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 16 Aug 2005
Article Copyright 2005 by Omar Al Zabir
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid