Click here to Skip to main content
15,896,915 members
Articles / Desktop Programming / Windows Forms

Windows Services Made Simple

Rate me:
Please Sign up or sign in to vote.
4.62/5 (10 votes)
27 Jun 2007CPOL10 min read 94.6K   6.9K   69  
Describes how to build a Windows Service using the Pegasus Library.
using System;

using Pegasus.Diagnostics;

namespace Pegasus.Workflow.Service
{
	/// <summary>
	/// Exception when a specific workflow type or id can not be found in the data store.
	/// </summary>
	[Serializable]
	public class WorkflowNotFoundException : WorkflowException
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="T:WorkflowNotFoundException"/> class.
		/// </summary>
		/// <param name="workflowId">The workflow id.</param>
		public WorkflowNotFoundException( int workflowId ) :
			base( string.Format( "Workflow {0} was not found.", workflowId ) )
		{
			// Check Parameters
			ParamCode.AssertRange( workflowId, 1, int.MaxValue, "workflowId" );
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="T:WorkflowNotFoundException"/> class.
		/// </summary>
		/// <param name="workflowId">The workflow id.</param>
		/// <param name="innerException">The inner exception.</param>
		public WorkflowNotFoundException( int workflowId, Exception innerException ) :
			base( innerException, "Workflow {0} was not found.", workflowId )
		{
			// Check Parameters
			ParamCode.AssertRange( workflowId, 1, int.MaxValue, "workflowId" );
			ParamCode.AssertNotNull( innerException, "innerException" );
		}
	}
}

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)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions