Click here to Skip to main content
15,884,388 members
Articles / Programming Languages / C#

A New Task Scheduler Class Library for .NET

Rate me:
Please Sign up or sign in to vote.
4.93/5 (233 votes)
17 Dec 2007CPOL15 min read 3.7M   63.3K   634  
A revision of a Task Scheduler class library by David Hall
using System;
using System.Collections;
using System.Runtime.InteropServices;
using TaskSchedulerInterop;

namespace TaskScheduler
{
	/// <summary>
	/// Deprecated.  For V1 compatibility only. 
	/// </summary>
	/// <remarks>
	/// <p>Scheduler is just a wrapper around the TaskList class.</p>
	/// <p><i>Provided for compatibility with version one of the library.  Use of Scheduler
	/// and TaskList will normally result in COM memory leaks.</i></p>
	/// </remarks>
	public class Scheduler
	{
		/// <summary>
		/// Internal field which holds TaskList instance
		/// </summary>
		private readonly TaskList tasks = null;

		/// <summary>
		/// Creates instance of task scheduler on local machine
		/// </summary>
		public Scheduler()
		{
			tasks = new TaskList();
		}

		/// <summary>
		/// Creates instance of task scheduler on remote machine
		/// </summary>
		/// <param name="computer">Name of remote machine</param>
		public Scheduler(string computer)
		{
			tasks = new TaskList();
			TargetComputer = computer;
		}

		/// <summary>
		/// Gets/sets name of target computer. Null or emptry string specifies local computer.
		/// </summary>
		public string TargetComputer
		{
			get
			{
				return tasks.TargetComputer;
			}
			set
			{
				tasks.TargetComputer = value;
			}
		}

		/// <summary>
		/// Gets collection of system tasks
		/// </summary>
		public TaskList Tasks
		{
			get
			{
				return tasks;
			}
		}

	}
}

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
I'm a long-time programmer in compilers, operating systems, microprogramming, applications, and web programming. I've got way too many years of experience piled up--old Burroughs mainframes, Unix, Macintosh, and Windows.

Software was finally beginning to get boring, but then along came .Net and brought the fun back!

Comments and Discussions