Click here to Skip to main content
15,886,199 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.3K   6.9K   69  
Describes how to build a Windows Service using the Pegasus Library.
using System;

using Pegasus.Diagnostics;

namespace Pegasus.Workflow.Service
{
	/// <summary>
	/// Event args for when the status of a workflow changes
	/// </summary>
	[Serializable]
	public class WorkflowStatusEventArgs : WorkflowEventArgs
	{
		// Local Instance Values
		private WorkflowStatus m_oldStatus;
		private WorkflowStatus m_newStatus;

		/// <summary>
		/// Initializes a new instance of the <see cref="T:WorkflowStatusEventArgs"/> class.
		/// </summary>
		/// <param name="workflowId">The workflow id.</param>
		/// <param name="oldStatus">The old status.</param>
		/// <param name="newStatus">The new status.</param>
		public WorkflowStatusEventArgs( int workflowId, WorkflowStatus oldStatus, WorkflowStatus newStatus ) :
			base( workflowId )
		{
			// Check Parameters
			ParamCode.AssertRange( workflowId, 1, int.MaxValue, "workflowId" );

			m_oldStatus = oldStatus;
			m_newStatus = newStatus;
		}

		/// <summary>
		/// Gets the old status.
		/// </summary>
		/// <value>The old status.</value>
		public WorkflowStatus OldStatus
		{
			get
			{
				return m_oldStatus;
			}
		}

		/// <summary>
		/// Gets the new status.
		/// </summary>
		/// <value>The new status.</value>
		public WorkflowStatus NewStatus
		{
			get
			{
				return m_newStatus;
			}
		}
	}
}

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