Index: /branches/eraser6/Manager/Task.cs
===================================================================
--- /branches/eraser6/Manager/Task.cs	(revision 914)
+++ /branches/eraser6/Manager/Task.cs	(revision 915)
@@ -37,687 +37,4 @@
 	public class Task : ISerializable
 	{
-		/// <summary>
-		/// Represents a generic target of erasure
-		/// </summary>
-		[Serializable]
-		public abstract class ErasureTarget : ISerializable
-		{
-			#region Serialization code
-			public ErasureTarget(SerializationInfo info, StreamingContext context)
-			{
-				Guid methodGuid = (Guid)info.GetValue("Method", typeof(Guid));
-				if (methodGuid == Guid.Empty)
-					method = ErasureMethodManager.Default;
-				else
-					method = ErasureMethodManager.GetInstance(methodGuid);
-			}
-
-			public virtual void GetObjectData(SerializationInfo info,
-				StreamingContext context)
-			{
-				info.AddValue("Method", method.Guid);
-			}
-			#endregion
-
-			/// <summary>
-			/// Constructor.
-			/// </summary>
-			public ErasureTarget()
-			{
-			}
-
-			/// <summary>
-			/// The method used for erasing the file. If the variable is equal to
-			/// ErasureMethodManager.Default then the default is queried for the
-			/// task type.
-			/// </summary>
-			public abstract ErasureMethod Method
-			{
-				get;
-				set;
-			}
-
-			/// <summary>
-			/// Checks whether a method has been selected for this target. This is
-			/// because the Method property will return non-default erasure methods
-			/// only.
-			/// </summary>
-			public bool MethodDefined
-			{
-				get
-				{
-					return method != ErasureMethodManager.Default;
-				}
-			}
-
-			/// <summary>
-			/// The task which owns this target.
-			/// </summary>
-			public Task Task
-			{
-				get
-				{
-					return task;
-				}
-				internal set
-				{
-					task = value;
-				}
-			}
-
-			/// <summary>
-			/// Retrieves the text to display representing this task.
-			/// </summary>
-			public abstract string UIText
-			{
-				get;
-			}
-
-			/// <summary>
-			/// Retrieves the amount of data that needs to be written in order to
-			/// complete the erasure.
-			/// </summary>
-			public abstract long TotalData
-			{
-				get;
-			}
-
-			/// <summary>
-			/// Erasure method to use for the target.
-			/// </summary>
-			protected ErasureMethod method;
-
-			/// <summary>
-			/// The task object owning this target.
-			/// </summary>
-			private Task task;
-		}
-
-		/// <summary>
-		/// Class representing a tangible object (file/folder) to be erased.
-		/// </summary>
-		[Serializable]
-		public abstract class FilesystemObject : ErasureTarget
-		{
-			#region Serialization code
-			public FilesystemObject(SerializationInfo info, StreamingContext context)
-				: base(info, context)
-			{
-				path = (string)info.GetValue("Path", typeof(string));
-			}
-
-			override public void GetObjectData(SerializationInfo info,
-				StreamingContext context)
-			{
-				base.GetObjectData(info, context);
-				info.AddValue("Path", path);
-			}
-			#endregion
-
-			/// <summary>
-			/// Constructor.
-			/// </summary>
-			public FilesystemObject()
-			{
-			}
-
-			/// <summary>
-			/// Retrieves the list of files/folders to erase as a list.
-			/// </summary>
-			/// <param name="totalSize">Returns the total size in bytes of the
-			/// items.</param>
-			/// <returns>A list containing the paths to all the files to be erased.</returns>
-			internal abstract List<string> GetPaths(out long totalSize);
-
-			/// <summary>
-			/// Adds ADSes of the given file to the list.
-			/// </summary>
-			/// <param name="list">The list to add the ADS paths to.</param>
-			/// <param name="file">The file to look for ADSes</param>
-			protected void GetPathADSes(ref List<string> list, ref long totalSize, string file)
-			{
-				try
-				{
-					//Get the ADS names
-					List<string> adses = Util.File.GetADSes(new FileInfo(file));
-
-					//Then prepend the path.
-					foreach (string adsName in adses)
-					{
-						string adsPath = file + ':' + adsName;
-						list.Add(adsPath);
-						Util.StreamInfo info = new Util.StreamInfo(adsPath);
-						totalSize += info.Length;
-					}
-				}
-				catch (UnauthorizedAccessException e)
-				{
-					//The system cannot read the file, assume no ADSes for lack of
-					//more information.
-					Task.Log.Add(new LogEntry(e.Message, LogLevel.Error));
-				}
-			}
-
-			/// <summary>
-			/// The path to the file or folder referred to by this object.
-			/// </summary>
-			public string Path
-			{
-				get { return path; }
-				set { path = value; }
-			}
-
-			public override ErasureMethod Method
-			{
-				get
-				{
-					if (method != ErasureMethodManager.Default)
-						return method;
-					return ErasureMethodManager.GetInstance(
-						ManagerLibrary.Instance.Settings.DefaultFileErasureMethod);
-				}
-				set
-				{
-					method = value;
-				}
-			}
-
-			public override string UIText
-			{
-				get { return Path; }
-			}
-
-			public override long TotalData
-			{
-				get
-				{
-					long totalSize = 0;
-					List<string> paths = GetPaths(out totalSize);
-					return Method.CalculateEraseDataSize(paths, totalSize);
-				}
-			}
-
-			private string path;
-		}
-
-		/// <summary>
-		/// Class representing a unused space erase.
-		/// </summary>
-		[Serializable]
-		public class UnusedSpace : ErasureTarget
-		{
-			#region Serialization code
-			UnusedSpace(SerializationInfo info, StreamingContext context)
-				: base(info, context)
-			{
-				Drive = (string)info.GetValue("Drive", typeof(string));
-				EraseClusterTips = (bool)info.GetValue("EraseClusterTips", typeof(bool));
-			}
-
-			public override void GetObjectData(SerializationInfo info,
-				StreamingContext context)
-			{
-				base.GetObjectData(info, context);
-				info.AddValue("Drive", Drive);
-				info.AddValue("EraseClusterTips", EraseClusterTips);
-			}
-			#endregion
-
-			/// <summary>
-			/// Constructor.
-			/// </summary>
-			public UnusedSpace()
-			{
-			}
-
-			public override ErasureMethod Method
-			{
-				get
-				{
-					if (method != ErasureMethodManager.Default)
-						return method;
-					return ErasureMethodManager.GetInstance(
-						ManagerLibrary.Instance.Settings.DefaultUnusedSpaceErasureMethod);
-				}
-				set
-				{
-					method = value;
-				}
-			}
-
-			public override string UIText
-			{
-				get { return S._("Unused disk space ({0})", Drive); }
-			}
-
-			public override long TotalData
-			{
-				get
-				{
-					VolumeInfo info = VolumeInfo.FromMountpoint(Drive);
-					return Method.CalculateEraseDataSize(null, info.AvailableFreeSpace);
-				}
-			}
-
-			/// <summary>
-			/// The drive to erase
-			/// </summary>
-			public string Drive { get; set; }
-
-			/// <summary>
-			/// Whether cluster tips should be erased.
-			/// </summary>
-			public bool EraseClusterTips { get; set; }
-		}
-
-		/// <summary>
-		/// Class representing a file to be erased.
-		/// </summary>
-		[Serializable]
-		public class File : FilesystemObject
-		{
-			#region Serialization code
-			protected File(SerializationInfo info, StreamingContext context)
-				: base(info, context)
-			{
-			}
-			#endregion
-
-			/// <summary>
-			/// Constructor.
-			/// </summary>
-			public File()
-			{
-			}
-
-			internal override List<string> GetPaths(out long totalSize)
-			{
-				List<string> result = new List<string>();
-				totalSize = 0;
-				GetPathADSes(ref result, ref totalSize, Path);
-
-				totalSize += new FileInfo(Path).Length;
-				result.Add(Path);
-				return result;
-			}
-		}
-
-		/// <summary>
-		/// Represents a folder and its files which are to be erased.
-		/// </summary>
-		[Serializable]
-		public class Folder : FilesystemObject
-		{
-			#region Serialization code
-			protected Folder(SerializationInfo info, StreamingContext context)
-				: base(info, context)
-			{
-				includeMask = (string)info.GetValue("IncludeMask", typeof(string));
-				excludeMask = (string)info.GetValue("ExcludeMask", typeof(string));
-				deleteIfEmpty = (bool)info.GetValue("DeleteIfEmpty", typeof(bool));
-			}
-
-			public override void GetObjectData(SerializationInfo info,
-				StreamingContext context)
-			{
-				base.GetObjectData(info, context);
-				info.AddValue("IncludeMask", includeMask);
-				info.AddValue("ExcludeMask", excludeMask);
-				info.AddValue("DeleteIfEmpty", deleteIfEmpty);
-			}
-			#endregion
-
-			/// <summary>
-			/// Constructor.
-			/// </summary>
-			public Folder()
-			{
-			}
-
-			internal override List<string> GetPaths(out long totalSize)
-			{
-				//Get a list to hold all the resulting paths.
-				List<string> result = new List<string>();
-
-				//Open the root of the search, including every file matching the pattern
-				DirectoryInfo dir = new DirectoryInfo(Path);
-
-				//List recursively all the files which match the include pattern.
-				string includeMask = IncludeMask;
-				if (includeMask.Length == 0)
-					includeMask = "*";
-				FileInfo[] files = GetFiles(dir, includeMask);
-
-				//Then exclude each file and finalize the list and total file size
-				totalSize = 0;
-				if (ExcludeMask.Length != 0)
-				{
-					string regex = Regex.Escape(ExcludeMask).Replace("\\*", ".*").
-						Replace("\\?", ".");
-					Regex excludePattern = new Regex(regex, RegexOptions.IgnoreCase);
-					foreach (FileInfo file in files)
-						if ((file.Attributes & FileAttributes.ReparsePoint) == 0 &&
-							excludePattern.Matches(file.FullName).Count == 0)
-						{
-							totalSize += file.Length;
-							GetPathADSes(ref result, ref totalSize, file.FullName);
-							result.Add(file.FullName);
-						}
-				}
-				else
-					foreach (FileInfo file in files)
-					{
-						if ((file.Attributes & FileAttributes.ReparsePoint) != 0)
-							continue;
-
-						totalSize += file.Length;
-						GetPathADSes(ref result, ref totalSize, file.FullName);
-						result.Add(file.FullName);
-					}
-
-				//Return the filtered list.
-				return result;
-			}
-
-			/// <summary>
-			/// Gets all files in the provided directory.
-			/// </summary>
-			/// <param name="info">The directory to look files in.</param>
-			/// <param name="includeMask">The include mask all files must match.</param>
-			/// <returns>A list of files found in the directory.</returns>
-			private FileInfo[] GetFiles(DirectoryInfo info, string includeMask)
-			{
-				List<FileInfo> result = new List<FileInfo>();
-				foreach (DirectoryInfo dir in info.GetDirectories())
-					try
-					{
-						result.AddRange(GetFiles(dir, includeMask));
-					}
-					catch (Exception e)
-					{
-						//Ignore, but log.
-						Task.log.Add(new LogEntry(S._("Could not erase {0} because {1}",
-							dir.FullName, e.Message), LogLevel.Error));
-					}
-
-				result.AddRange(info.GetFiles(includeMask, SearchOption.TopDirectoryOnly));
-				return result.ToArray();
-			}
-
-			/// <summary>
-			/// A wildcard expression stating the condition for the set of files to include.
-			/// The include mask is applied before the exclude mask is applied. If this value
-			/// is empty, all files and folders within the folder specified is included.
-			/// </summary>
-			public string IncludeMask
-			{
-				get { return includeMask; }
-				set { includeMask = value; }
-			}
-
-			/// <summary>
-			/// A wildcard expression stating the condition for removing files from the set
-			/// of included files. If this value is omitted, all files and folders extracted
-			/// by the inclusion mask is erased.
-			/// </summary>
-			public string ExcludeMask
-			{
-				get { return excludeMask; }
-				set { excludeMask = value; }
-			}
-
-			/// <summary>
-			/// Determines if Eraser should delete the folder after the erase process.
-			/// </summary>
-			public bool DeleteIfEmpty
-			{
-				get { return deleteIfEmpty; }
-				set { deleteIfEmpty = value; }
-			}
-
-			private string includeMask = string.Empty;
-			private string excludeMask = string.Empty;
-			private bool deleteIfEmpty = true;
-		}
-
-		[Serializable]
-		public class RecycleBin : FilesystemObject
-		{
-			#region Serialization code
-			protected RecycleBin(SerializationInfo info, StreamingContext context)
-				: base(info, context)
-			{
-			}
-			#endregion
-
-			public RecycleBin()
-			{
-			}
-
-			internal override List<string> GetPaths(out long totalSize)
-			{
-				totalSize = 0;
-				List<string> result = new List<string>();
-				string[] rootDirectory = new string[] {
-					"$RECYCLE.BIN",
-					"RECYCLER"
-				};
-
-				foreach (DriveInfo drive in DriveInfo.GetDrives())
-				{
-					foreach (string rootDir in rootDirectory)
-					{
-						DirectoryInfo dir = new DirectoryInfo(
-							System.IO.Path.Combine(
-								System.IO.Path.Combine(drive.Name, rootDir),
-								System.Security.Principal.WindowsIdentity.GetCurrent().
-									User.ToString()));
-						if (!dir.Exists)
-							continue;
-
-						GetRecyclerFiles(dir, ref result, ref totalSize);
-					}
-				}
-
-				return result;
-			}
-
-			/// <summary>
-			/// Retrieves all files within this folder, without exclusions.
-			/// </summary>
-			/// <param name="info">The DirectoryInfo object representing the folder to traverse.</param>
-			/// <param name="paths">The list of files to store path information in.</param>
-			/// <param name="totalSize">Receives the total size of the files.</param>
-			private void GetRecyclerFiles(DirectoryInfo info, ref List<string> paths,
-				ref long totalSize)
-			{
-				try
-				{
-					foreach (FileSystemInfo fsInfo in info.GetFileSystemInfos())
-					{
-						if (fsInfo is FileInfo)
-						{
-							paths.Add(fsInfo.FullName);
-							totalSize += ((FileInfo)fsInfo).Length;
-							GetPathADSes(ref paths, ref totalSize, fsInfo.FullName);
-						}
-						else
-							GetRecyclerFiles((DirectoryInfo)fsInfo, ref paths, ref totalSize);
-					}
-				}
-				catch (UnauthorizedAccessException e)
-				{
-					Task.Log.Add(new LogEntry(e.Message, LogLevel.Error));
-				}
-			}
-
-			/// <summary>
-			/// Retrieves the text to display representing this task.
-			/// </summary>
-			public override string UIText
-			{
-				get
-				{
-					return S._("Recycle Bin");
-				}
-			}
-		}
-
-		/// <summary>
-		/// Maintains a collection of erasure targets.
-		/// </summary>
-		[Serializable]
-		public class ErasureTargetsCollection : IList<ErasureTarget>, ICollection<ErasureTarget>,
-			IEnumerable<ErasureTarget>, ISerializable
-		{
-			#region Constructors
-			internal ErasureTargetsCollection(Task owner)
-			{
-				this.list = new List<ErasureTarget>();
-				this.owner = owner;
-			}
-
-			internal ErasureTargetsCollection(Task owner, int capacity)
-				: this(owner)
-			{
-				list.Capacity = capacity;
-			}
-
-			internal ErasureTargetsCollection(Task owner, IEnumerable<ErasureTarget> targets)
-				: this(owner)
-			{
-				list.AddRange(targets);
-			}
-			#endregion
-
-			#region Serialization Code
-			protected ErasureTargetsCollection(SerializationInfo info, StreamingContext context)
-			{
-				list = (List<ErasureTarget>)info.GetValue("list", typeof(List<ErasureTarget>));
-			}
-
-			public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
-			{
-				info.AddValue("list", list);
-			}
-			#endregion
-
-			#region IEnumerable<ErasureTarget> Members
-			public IEnumerator<ErasureTarget> GetEnumerator()
-			{
-				return list.GetEnumerator();
-			}
-			#endregion
-
-			#region IEnumerable Members
-			System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
-			{
-				return list.GetEnumerator();
-			}
-			#endregion
-
-			#region ICollection<ErasureTarget> Members
-			public void Add(ErasureTarget item)
-			{
-				item.Task = owner;
-				list.Add(item);
-			}
-
-			public void Clear()
-			{
-				list.Clear();
-			}
-
-			public bool Contains(ErasureTarget item)
-			{
-				return list.Contains(item);
-			}
-
-			public void CopyTo(ErasureTarget[] array, int arrayIndex)
-			{
-				list.CopyTo(array, arrayIndex);
-			}
-
-			public int Count
-			{
-				get
-				{
-					return list.Count;
-				}
-			}
-
-			public bool IsReadOnly
-			{
-				get
-				{
-					return IsReadOnly;
-				}
-			}
-
-			public bool Remove(ErasureTarget item)
-			{
-				return list.Remove(item);
-			}
-			#endregion
-
-			#region IList<ErasureTarget> Members
-			public int IndexOf(ErasureTarget item)
-			{
-				return list.IndexOf(item);
-			}
-
-			public void Insert(int index, ErasureTarget item)
-			{
-				item.Task = owner;
-				list.Insert(index, item);
-			}
-
-			public void RemoveAt(int index)
-			{
-				list.RemoveAt(index);
-			}
-
-			public ErasureTarget this[int index]
-			{
-				get
-				{
-					return list[index];
-				}
-				set
-				{
-					list[index] = value;
-				}
-			}
-			#endregion
-
-			/// <summary>
-			/// The ownere of this list of targets.
-			/// </summary>
-			public Task Owner
-			{
-				get
-				{
-					return owner;
-				}
-				internal set
-				{
-					owner = value;
-					foreach (ErasureTarget target in list)
-						target.Task = owner;
-				}
-			}
-
-			/// <summary>
-			/// The owner of this list of targets. All targets added to this list
-			/// will have the owner set to this object.
-			/// </summary>
-			private Task owner;
-
-			/// <summary>
-			/// The list bring the data store behind this object.
-			/// </summary>
-			List<ErasureTarget> list;
-		}
-
 		#region Serialization code
 		protected Task(SerializationInfo info, StreamingContext context)
@@ -741,5 +58,5 @@
 		}
 
-		public void GetObjectData(SerializationInfo info, StreamingContext context)
+		public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
 		{
 			info.AddValue("ID", id);
@@ -765,5 +82,5 @@
 		/// executions.
 		/// </summary>
-		public uint ID
+		public uint Id
 		{
 			get { return id; }
@@ -804,5 +121,5 @@
 				if (Targets.Count < 3)
 					//Simpler case, small set of data.
-					foreach (Task.ErasureTarget tgt in Targets)
+					foreach (ErasureTarget tgt in Targets)
 						result += tgt.UIText + ", ";
 				else
@@ -943,4 +260,687 @@
 
 	/// <summary>
+	/// Represents a generic target of erasure
+	/// </summary>
+	[Serializable]
+	public abstract class ErasureTarget : ISerializable
+	{
+		#region Serialization code
+		protected ErasureTarget(SerializationInfo info, StreamingContext context)
+		{
+			Guid methodGuid = (Guid)info.GetValue("Method", typeof(Guid));
+			if (methodGuid == Guid.Empty)
+				method = ErasureMethodManager.Default;
+			else
+				method = ErasureMethodManager.GetInstance(methodGuid);
+		}
+
+		public virtual void GetObjectData(SerializationInfo info,
+			StreamingContext context)
+		{
+			info.AddValue("Method", method.Guid);
+		}
+		#endregion
+
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		protected ErasureTarget()
+		{
+		}
+
+		/// <summary>
+		/// The method used for erasing the file. If the variable is equal to
+		/// ErasureMethodManager.Default then the default is queried for the
+		/// task type.
+		/// </summary>
+		public abstract ErasureMethod Method
+		{
+			get;
+			set;
+		}
+
+		/// <summary>
+		/// Checks whether a method has been selected for this target. This is
+		/// because the Method property will return non-default erasure methods
+		/// only.
+		/// </summary>
+		public bool MethodDefined
+		{
+			get
+			{
+				return method != ErasureMethodManager.Default;
+			}
+		}
+
+		/// <summary>
+		/// The task which owns this target.
+		/// </summary>
+		public Task Task
+		{
+			get
+			{
+				return task;
+			}
+			internal set
+			{
+				task = value;
+			}
+		}
+
+		/// <summary>
+		/// Retrieves the text to display representing this task.
+		/// </summary>
+		public abstract string UIText
+		{
+			get;
+		}
+
+		/// <summary>
+		/// Retrieves the amount of data that needs to be written in order to
+		/// complete the erasure.
+		/// </summary>
+		public abstract long TotalData
+		{
+			get;
+		}
+
+		/// <summary>
+		/// Erasure method to use for the target.
+		/// </summary>
+		protected ErasureMethod method { get; set; }
+
+		/// <summary>
+		/// The task object owning this target.
+		/// </summary>
+		private Task task;
+	}
+
+	/// <summary>
+	/// Class representing a tangible object (file/folder) to be erased.
+	/// </summary>
+	[Serializable]
+	public abstract class FileSystemObjectTarget : ErasureTarget
+	{
+		#region Serialization code
+		protected FileSystemObjectTarget(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+			path = (string)info.GetValue("Path", typeof(string));
+		}
+
+		override public void GetObjectData(SerializationInfo info,
+			StreamingContext context)
+		{
+			base.GetObjectData(info, context);
+			info.AddValue("Path", path);
+		}
+		#endregion
+
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		protected FileSystemObjectTarget()
+		{
+		}
+
+		/// <summary>
+		/// Retrieves the list of files/folders to erase as a list.
+		/// </summary>
+		/// <param name="totalSize">Returns the total size in bytes of the
+		/// items.</param>
+		/// <returns>A list containing the paths to all the files to be erased.</returns>
+		internal abstract List<string> GetPaths(out long totalSize);
+
+		/// <summary>
+		/// Adds ADSes of the given file to the list.
+		/// </summary>
+		/// <param name="list">The list to add the ADS paths to.</param>
+		/// <param name="file">The file to look for ADSes</param>
+		protected void GetPathADSes(ref List<string> list, ref long totalSize, string file)
+		{
+			try
+			{
+				//Get the ADS names
+				List<string> adses = Util.File.GetADSes(new FileInfo(file));
+
+				//Then prepend the path.
+				foreach (string adsName in adses)
+				{
+					string adsPath = file + ':' + adsName;
+					list.Add(adsPath);
+					Util.StreamInfo info = new Util.StreamInfo(adsPath);
+					totalSize += info.Length;
+				}
+			}
+			catch (UnauthorizedAccessException e)
+			{
+				//The system cannot read the file, assume no ADSes for lack of
+				//more information.
+				Task.Log.Add(new LogEntry(e.Message, LogLevel.Error));
+			}
+		}
+
+		/// <summary>
+		/// The path to the file or folder referred to by this object.
+		/// </summary>
+		public string Path
+		{
+			get { return path; }
+			set { path = value; }
+		}
+
+		public override ErasureMethod Method
+		{
+			get
+			{
+				if (method != ErasureMethodManager.Default)
+					return method;
+				return ErasureMethodManager.GetInstance(
+					ManagerLibrary.Instance.Settings.DefaultFileErasureMethod);
+			}
+			set
+			{
+				method = value;
+			}
+		}
+
+		public override string UIText
+		{
+			get { return Path; }
+		}
+
+		public override long TotalData
+		{
+			get
+			{
+				long totalSize = 0;
+				List<string> paths = GetPaths(out totalSize);
+				return Method.CalculateEraseDataSize(paths, totalSize);
+			}
+		}
+
+		private string path;
+	}
+
+	/// <summary>
+	/// Class representing a unused space erase.
+	/// </summary>
+	[Serializable]
+	public class UnusedSpaceTarget : ErasureTarget
+	{
+		#region Serialization code
+		protected UnusedSpaceTarget(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+			Drive = (string)info.GetValue("Drive", typeof(string));
+			EraseClusterTips = (bool)info.GetValue("EraseClusterTips", typeof(bool));
+		}
+
+		public override void GetObjectData(SerializationInfo info,
+			StreamingContext context)
+		{
+			base.GetObjectData(info, context);
+			info.AddValue("Drive", Drive);
+			info.AddValue("EraseClusterTips", EraseClusterTips);
+		}
+		#endregion
+
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		public UnusedSpaceTarget()
+		{
+		}
+
+		public override ErasureMethod Method
+		{
+			get
+			{
+				if (method != ErasureMethodManager.Default)
+					return method;
+				return ErasureMethodManager.GetInstance(
+					ManagerLibrary.Instance.Settings.DefaultUnusedSpaceErasureMethod);
+			}
+			set
+			{
+				method = value;
+			}
+		}
+
+		public override string UIText
+		{
+			get { return S._("Unused disk space ({0})", Drive); }
+		}
+
+		public override long TotalData
+		{
+			get
+			{
+				VolumeInfo info = VolumeInfo.FromMountpoint(Drive);
+				return Method.CalculateEraseDataSize(null, info.AvailableFreeSpace);
+			}
+		}
+
+		/// <summary>
+		/// The drive to erase
+		/// </summary>
+		public string Drive { get; set; }
+
+		/// <summary>
+		/// Whether cluster tips should be erased.
+		/// </summary>
+		public bool EraseClusterTips { get; set; }
+	}
+
+	/// <summary>
+	/// Class representing a file to be erased.
+	/// </summary>
+	[Serializable]
+	public class FileTarget : FileSystemObjectTarget
+	{
+		#region Serialization code
+		protected FileTarget(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
+		#endregion
+
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		public FileTarget()
+		{
+		}
+
+		internal override List<string> GetPaths(out long totalSize)
+		{
+			List<string> result = new List<string>();
+			totalSize = 0;
+			GetPathADSes(ref result, ref totalSize, Path);
+
+			totalSize += new FileInfo(Path).Length;
+			result.Add(Path);
+			return result;
+		}
+	}
+
+	/// <summary>
+	/// Represents a folder and its files which are to be erased.
+	/// </summary>
+	[Serializable]
+	public class FolderTarget : FileSystemObjectTarget
+	{
+		#region Serialization code
+		protected FolderTarget(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+			includeMask = (string)info.GetValue("IncludeMask", typeof(string));
+			excludeMask = (string)info.GetValue("ExcludeMask", typeof(string));
+			deleteIfEmpty = (bool)info.GetValue("DeleteIfEmpty", typeof(bool));
+		}
+
+		public override void GetObjectData(SerializationInfo info,
+			StreamingContext context)
+		{
+			base.GetObjectData(info, context);
+			info.AddValue("IncludeMask", includeMask);
+			info.AddValue("ExcludeMask", excludeMask);
+			info.AddValue("DeleteIfEmpty", deleteIfEmpty);
+		}
+		#endregion
+
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		public FolderTarget()
+		{
+		}
+
+		internal override List<string> GetPaths(out long totalSize)
+		{
+			//Get a list to hold all the resulting paths.
+			List<string> result = new List<string>();
+
+			//Open the root of the search, including every file matching the pattern
+			DirectoryInfo dir = new DirectoryInfo(Path);
+
+			//List recursively all the files which match the include pattern.
+			string includeMask = IncludeMask;
+			if (includeMask.Length == 0)
+				includeMask = "*";
+			FileInfo[] files = GetFiles(dir, includeMask);
+
+			//Then exclude each file and finalize the list and total file size
+			totalSize = 0;
+			if (ExcludeMask.Length != 0)
+			{
+				string regex = Regex.Escape(ExcludeMask).Replace("\\*", ".*").
+					Replace("\\?", ".");
+				Regex excludePattern = new Regex(regex, RegexOptions.IgnoreCase);
+				foreach (FileInfo file in files)
+					if ((file.Attributes & FileAttributes.ReparsePoint) == 0 &&
+						excludePattern.Matches(file.FullName).Count == 0)
+					{
+						totalSize += file.Length;
+						GetPathADSes(ref result, ref totalSize, file.FullName);
+						result.Add(file.FullName);
+					}
+			}
+			else
+				foreach (FileInfo file in files)
+				{
+					if ((file.Attributes & FileAttributes.ReparsePoint) != 0)
+						continue;
+
+					totalSize += file.Length;
+					GetPathADSes(ref result, ref totalSize, file.FullName);
+					result.Add(file.FullName);
+				}
+
+			//Return the filtered list.
+			return result;
+		}
+
+		/// <summary>
+		/// Gets all files in the provided directory.
+		/// </summary>
+		/// <param name="info">The directory to look files in.</param>
+		/// <param name="includeMask">The include mask all files must match.</param>
+		/// <returns>A list of files found in the directory.</returns>
+		private FileInfo[] GetFiles(DirectoryInfo info, string includeMask)
+		{
+			List<FileInfo> result = new List<FileInfo>();
+			foreach (DirectoryInfo dir in info.GetDirectories())
+				try
+				{
+					result.AddRange(GetFiles(dir, includeMask));
+				}
+				catch (Exception e)
+				{
+					//Ignore, but log.
+					Task.Log.Add(new LogEntry(S._("Could not erase {0} because {1}",
+						dir.FullName, e.Message), LogLevel.Error));
+				}
+
+			result.AddRange(info.GetFiles(includeMask, SearchOption.TopDirectoryOnly));
+			return result.ToArray();
+		}
+
+		/// <summary>
+		/// A wildcard expression stating the condition for the set of files to include.
+		/// The include mask is applied before the exclude mask is applied. If this value
+		/// is empty, all files and folders within the folder specified is included.
+		/// </summary>
+		public string IncludeMask
+		{
+			get { return includeMask; }
+			set { includeMask = value; }
+		}
+
+		/// <summary>
+		/// A wildcard expression stating the condition for removing files from the set
+		/// of included files. If this value is omitted, all files and folders extracted
+		/// by the inclusion mask is erased.
+		/// </summary>
+		public string ExcludeMask
+		{
+			get { return excludeMask; }
+			set { excludeMask = value; }
+		}
+
+		/// <summary>
+		/// Determines if Eraser should delete the folder after the erase process.
+		/// </summary>
+		public bool DeleteIfEmpty
+		{
+			get { return deleteIfEmpty; }
+			set { deleteIfEmpty = value; }
+		}
+
+		private string includeMask = string.Empty;
+		private string excludeMask = string.Empty;
+		private bool deleteIfEmpty = true;
+	}
+
+	[Serializable]
+	public class RecycleBinTarget : FileSystemObjectTarget
+	{
+		#region Serialization code
+		protected RecycleBinTarget(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
+		#endregion
+
+		public RecycleBinTarget()
+		{
+		}
+
+		internal override List<string> GetPaths(out long totalSize)
+		{
+			totalSize = 0;
+			List<string> result = new List<string>();
+			string[] rootDirectory = new string[] {
+					"$RECYCLE.BIN",
+					"RECYCLER"
+				};
+
+			foreach (DriveInfo drive in DriveInfo.GetDrives())
+			{
+				foreach (string rootDir in rootDirectory)
+				{
+					DirectoryInfo dir = new DirectoryInfo(
+						System.IO.Path.Combine(
+							System.IO.Path.Combine(drive.Name, rootDir),
+							System.Security.Principal.WindowsIdentity.GetCurrent().
+								User.ToString()));
+					if (!dir.Exists)
+						continue;
+
+					GetRecyclerFiles(dir, ref result, ref totalSize);
+				}
+			}
+
+			return result;
+		}
+
+		/// <summary>
+		/// Retrieves all files within this folder, without exclusions.
+		/// </summary>
+		/// <param name="info">The DirectoryInfo object representing the folder to traverse.</param>
+		/// <param name="paths">The list of files to store path information in.</param>
+		/// <param name="totalSize">Receives the total size of the files.</param>
+		private void GetRecyclerFiles(DirectoryInfo info, ref List<string> paths,
+			ref long totalSize)
+		{
+			try
+			{
+				foreach (FileSystemInfo fsInfo in info.GetFileSystemInfos())
+				{
+					if (fsInfo is FileInfo)
+					{
+						paths.Add(fsInfo.FullName);
+						totalSize += ((FileInfo)fsInfo).Length;
+						GetPathADSes(ref paths, ref totalSize, fsInfo.FullName);
+					}
+					else
+						GetRecyclerFiles((DirectoryInfo)fsInfo, ref paths, ref totalSize);
+				}
+			}
+			catch (UnauthorizedAccessException e)
+			{
+				Task.Log.Add(new LogEntry(e.Message, LogLevel.Error));
+			}
+		}
+
+		/// <summary>
+		/// Retrieves the text to display representing this task.
+		/// </summary>
+		public override string UIText
+		{
+			get
+			{
+				return S._("Recycle Bin");
+			}
+		}
+	}
+
+	/// <summary>
+	/// Maintains a collection of erasure targets.
+	/// </summary>
+	[Serializable]
+	public class ErasureTargetsCollection : IList<ErasureTarget>, ICollection<ErasureTarget>,
+		IEnumerable<ErasureTarget>, ISerializable
+	{
+		#region Constructors
+		internal ErasureTargetsCollection(Task owner)
+		{
+			this.list = new List<ErasureTarget>();
+			this.owner = owner;
+		}
+
+		internal ErasureTargetsCollection(Task owner, int capacity)
+			: this(owner)
+		{
+			list.Capacity = capacity;
+		}
+
+		internal ErasureTargetsCollection(Task owner, IEnumerable<ErasureTarget> targets)
+			: this(owner)
+		{
+			list.AddRange(targets);
+		}
+		#endregion
+
+		#region Serialization Code
+		protected ErasureTargetsCollection(SerializationInfo info, StreamingContext context)
+		{
+			list = (List<ErasureTarget>)info.GetValue("list", typeof(List<ErasureTarget>));
+		}
+
+		public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+		{
+			info.AddValue("list", list);
+		}
+		#endregion
+
+		#region IEnumerable<ErasureTarget> Members
+		public IEnumerator<ErasureTarget> GetEnumerator()
+		{
+			return list.GetEnumerator();
+		}
+		#endregion
+
+		#region IEnumerable Members
+		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+		{
+			return list.GetEnumerator();
+		}
+		#endregion
+
+		#region ICollection<ErasureTarget> Members
+		public void Add(ErasureTarget item)
+		{
+			item.Task = owner;
+			list.Add(item);
+		}
+
+		public void Clear()
+		{
+			list.Clear();
+		}
+
+		public bool Contains(ErasureTarget item)
+		{
+			return list.Contains(item);
+		}
+
+		public void CopyTo(ErasureTarget[] array, int arrayIndex)
+		{
+			list.CopyTo(array, arrayIndex);
+		}
+
+		public int Count
+		{
+			get
+			{
+				return list.Count;
+			}
+		}
+
+		public bool IsReadOnly
+		{
+			get
+			{
+				return IsReadOnly;
+			}
+		}
+
+		public bool Remove(ErasureTarget item)
+		{
+			return list.Remove(item);
+		}
+		#endregion
+
+		#region IList<ErasureTarget> Members
+		public int IndexOf(ErasureTarget item)
+		{
+			return list.IndexOf(item);
+		}
+
+		public void Insert(int index, ErasureTarget item)
+		{
+			item.Task = owner;
+			list.Insert(index, item);
+		}
+
+		public void RemoveAt(int index)
+		{
+			list.RemoveAt(index);
+		}
+
+		public ErasureTarget this[int index]
+		{
+			get
+			{
+				return list[index];
+			}
+			set
+			{
+				list[index] = value;
+			}
+		}
+		#endregion
+
+		/// <summary>
+		/// The ownere of this list of targets.
+		/// </summary>
+		public Task Owner
+		{
+			get
+			{
+				return owner;
+			}
+			internal set
+			{
+				owner = value;
+				foreach (ErasureTarget target in list)
+					target.Task = owner;
+			}
+		}
+
+		/// <summary>
+		/// The owner of this list of targets. All targets added to this list
+		/// will have the owner set to this object.
+		/// </summary>
+		private Task owner;
+
+		/// <summary>
+		/// The list bring the data store behind this object.
+		/// </summary>
+		List<ErasureTarget> list;
+	}
+
+	/// <summary>
 	/// A base event class for all event arguments involving a task.
 	/// </summary>
@@ -1001,5 +1001,5 @@
 		/// The current erasure target - the current item being erased.
 		/// </summary>
-		public Task.ErasureTarget CurrentTarget
+		public ErasureTarget CurrentTarget
 		{
 			get { return currentTarget; }
@@ -1069,5 +1069,5 @@
 		private TimeSpan timeLeft = new TimeSpan(0, 0, -1);
 
-		private Task.ErasureTarget currentTarget;
+		private ErasureTarget currentTarget;
 		private int currentTargetIndex;
 		private int currentTargetTotalPasses;
Index: /branches/eraser6/Manager/Strings.resx
===================================================================
--- /branches/eraser6/Manager/Strings.resx	(revision 914)
+++ /branches/eraser6/Manager/Strings.resx	(revision 915)
@@ -292,4 +292,7 @@
     <value>The ScheduleUnit of the schedule does not use the WeeklyScheduly value, this field would contain garbage</value>
   </data>
+  <data name="An invalid type was found when loading the task schedule" xml:space="preserve">
+    <value>An invalid type was found when loading the task schedule</value>
+  </data>
   <data name="Unused disk space ({0})" xml:space="preserve">
     <value>Unused disk space ({0})</value>
@@ -301,6 +304,3 @@
     <value>Recycle Bin</value>
   </data>
-  <data name="An invalid type was found when loading the task schedule" xml:space="preserve">
-    <value>An invalid type was found when loading the task schedule</value>
-  </data>
 </root>
Index: /branches/eraser6/Manager/Strings.en.resx
===================================================================
--- /branches/eraser6/Manager/Strings.en.resx	(revision 914)
+++ /branches/eraser6/Manager/Strings.en.resx	(revision 915)
@@ -292,4 +292,7 @@
     <value>The ScheduleUnit of the schedule does not use the WeeklyScheduly value, this field would contain garbage</value>
   </data>
+  <data name="An invalid type was found when loading the task schedule" xml:space="preserve">
+    <value>An invalid type was found when loading the task schedule</value>
+  </data>
   <data name="Unused disk space ({0})" xml:space="preserve">
     <value>Unused disk space ({0})</value>
@@ -301,6 +304,3 @@
     <value>Recycle Bin</value>
   </data>
-  <data name="An invalid type was found when loading the task schedule" xml:space="preserve">
-    <value>An invalid type was found when loading the task schedule</value>
-  </data>
 </root>
Index: /branches/eraser6/Manager/PRNG.cs
===================================================================
--- /branches/eraser6/Manager/PRNG.cs	(revision 914)
+++ /branches/eraser6/Manager/PRNG.cs	(revision 915)
@@ -170,16 +170,16 @@
 		/// Retrieves the instance of the PRNG with the given GUID.
 		/// </summary>
-		/// <param name="guid">The GUID of the PRNG.</param>
+		/// <param name="value">The GUID of the PRNG.</param>
 		/// <returns>The PRNG instance.</returns>
-		public static Prng GetInstance(Guid guid)
+		public static Prng GetInstance(Guid value)
 		{
 			try
 			{
 				lock (ManagerLibrary.Instance.PRNGManager.prngs)
-					return ManagerLibrary.Instance.PRNGManager.prngs[guid];
+					return ManagerLibrary.Instance.PRNGManager.prngs[value];
 			}
 			catch (KeyNotFoundException)
 			{
-				throw new FatalException(S._("PRNG not found: {0}", guid.ToString()));
+				throw new FatalException(S._("PRNG not found: {0}", value.ToString()));
 			}
 		}
Index: /branches/eraser6/Manager/Manager.cs
===================================================================
--- /branches/eraser6/Manager/Manager.cs	(revision 914)
+++ /branches/eraser6/Manager/Manager.cs	(revision 915)
@@ -93,5 +93,5 @@
 		/// Global instance of the Settings manager.
 		/// </summary>
-		public SettingsManager SettingsManager;
+		public SettingsManager SettingsManager { get; set; }
 
 		/// <summary>
Index: /branches/eraser6/Manager/Strings.nl.resx
===================================================================
--- /branches/eraser6/Manager/Strings.nl.resx	(revision 914)
+++ /branches/eraser6/Manager/Strings.nl.resx	(revision 915)
@@ -292,4 +292,7 @@
     <value>(Untranslated)</value>
   </data>
+  <data name="An invalid type was found when loading the task schedule" xml:space="preserve">
+    <value>(Untranslated)</value>
+  </data>
   <data name="Unused disk space ({0})" xml:space="preserve">
     <value>(Untranslated)</value>
@@ -301,6 +304,3 @@
     <value>(Untranslated)</value>
   </data>
-  <data name="An invalid type was found when loading the task schedule" xml:space="preserve">
-    <value>(Untranslated)</value>
-  </data>
 </root>
Index: /branches/eraser6/Manager/Logger.cs
===================================================================
--- /branches/eraser6/Manager/Logger.cs	(revision 914)
+++ /branches/eraser6/Manager/Logger.cs	(revision 915)
@@ -95,5 +95,5 @@
 		/// </summary>
 		/// <param name="e"></param>
-		public delegate void LogEventFunction(LogEntry e);
+		public delegate void LogEventFunction(LogEntry entry);
 
 		/// <summary>
Index: /branches/eraser6/Manager/Method.cs
===================================================================
--- /branches/eraser6/Manager/Method.cs	(revision 914)
+++ /branches/eraser6/Manager/Method.cs	(revision 915)
@@ -103,5 +103,5 @@
 		/// instance, this function may be called across different threads.
 		/// </summary>
-		/// <param name="strm">The stream which needs to be erased.</param>
+		/// <param name="stream">The stream which needs to be erased.</param>
 		/// <param name="erasureLength">The length of the stream to erase. If all
 		/// data in the stream should be overwritten, then pass in the maximum
@@ -109,5 +109,5 @@
 		/// <param name="prng">The PRNG source for random data.</param>
 		/// <param name="callback">The progress callback function.</param>
-		public abstract void Erase(Stream strm, long erasureLength, Prng prng,
+		public abstract void Erase(Stream stream, long erasureLength, Prng prng,
 			ProgressFunction callback);
 
@@ -254,7 +254,7 @@
 		/// <param name="prng">The PRNG source for random data.</param>
 		/// <param name="callback">The progress callback function.</param>
-		public virtual void EraseUnusedSpace(Stream strm, Prng prng, ProgressFunction callback)
-		{
-			Erase(strm, long.MaxValue, prng, callback);
+		public virtual void EraseUnusedSpace(Stream stream, Prng prng, ProgressFunction callback)
+		{
+			Erase(stream, long.MaxValue, prng, callback);
 		}
 	}
@@ -538,6 +538,6 @@
 		/// The delegate prototype of the Method Registered event.
 		/// </summary>
-		/// <param name="method">The GUID of the method being registered.</param>
-		public delegate void MethodRegisteredFunction(Guid guid);
+		/// <param name="value">The GUID of the method being registered.</param>
+		public delegate void MethodRegisteredFunction(Guid value);
 
 		/// <summary>
@@ -549,6 +549,6 @@
 		/// The delegate prototype of the Method Unregistered event.
 		/// </summary>
-		/// <param name="method">The GUID of the method being registered.</param>
-		public delegate void MethodUnregisteredFunction(Guid guid);
+		/// <param name="value">The GUID of the method being registered.</param>
+		public delegate void MethodUnregisteredFunction(Guid value);
 
 		/// <summary>
Index: /branches/eraser6/Manager/EntropySource.cs
===================================================================
--- /branches/eraser6/Manager/EntropySource.cs	(revision 914)
+++ /branches/eraser6/Manager/EntropySource.cs	(revision 915)
@@ -145,17 +145,17 @@
 		/// Retrieves the instance of the EntropySource with the given GUID.
 		/// </summary>
-		/// <param name="guid">The GUID of the EntropySource.</param>
+		/// <param name="value">The GUID of the EntropySource.</param>
 		/// <returns>The EntropySource instance.</returns>
-		public static EntropySource GetInstance(Guid guid)
+		public static EntropySource GetInstance(Guid value)
 		{
 			try
 			{
 				lock (ManagerLibrary.Instance.EntropySourceManager.sources)
-					return ManagerLibrary.Instance.EntropySourceManager.sources[guid];
+					return ManagerLibrary.Instance.EntropySourceManager.sources[value];
 			}
 			catch (KeyNotFoundException)
 			{
 				throw new FatalException(S._("EntropySource GUID not found: {0}",
-					guid.ToString()));
+					value.ToString()));
 			}
 		}
@@ -197,6 +197,6 @@
 		/// The delegate prototype of Entropy Source Registered event 
 		/// </summary>
-		/// <param name="guid"></param>
-		public delegate void OnEntropySourceActivatedEventHandler(Guid guid);
+		/// <param name="value"></param>
+		public delegate void OnEntropySourceActivatedEventHandler(Guid value);
 
 		/// <summary>
Index: /branches/eraser6/Manager/Plugins.cs
===================================================================
--- /branches/eraser6/Manager/Plugins.cs	(revision 914)
+++ /branches/eraser6/Manager/Plugins.cs	(revision 915)
@@ -195,5 +195,5 @@
 				!MsCorEEAPI.VerifyStrongName(filePath) ||
 				instance.AssemblyAuthenticode == null) &&
-				!approvals.ContainsKey(instance.AssemblyInfo.GUID))
+				!approvals.ContainsKey(instance.AssemblyInfo.Guid))
 			{
 				return;
@@ -228,6 +228,6 @@
 
 			//See if the user disabled this plugin (users cannot disable Core plugins)
-			if (approvals.ContainsKey(instance.AssemblyInfo.GUID) &&
-				!approvals[instance.AssemblyInfo.GUID] && !instance.IsCore)
+			if (approvals.ContainsKey(instance.AssemblyInfo.Guid) &&
+				!approvals[instance.AssemblyInfo.Guid] && !instance.IsCore)
 			{
 				return;
@@ -304,5 +304,5 @@
 				foreach (CustomAttributeData attr in attributes)
 					if (attr.Constructor.DeclaringType == typeof(GuidAttribute))
-						assemblyInfo.GUID = new Guid((string)attr.ConstructorArguments[0].Value);
+						assemblyInfo.Guid = new Guid((string)attr.ConstructorArguments[0].Value);
 					else if (attr.Constructor.DeclaringType == typeof(AssemblyCompanyAttribute))
 						assemblyInfo.Author = (string)attr.ConstructorArguments[0].Value;
@@ -383,5 +383,5 @@
 		/// The GUID of the assembly.
 		/// </summary>
-		public Guid GUID { get; set; }
+		public Guid Guid { get; set; }
 
 		/// <summary>
Index: /branches/eraser6/Manager/DirectExecutor.cs
===================================================================
--- /branches/eraser6/Manager/DirectExecutor.cs	(revision 914)
+++ /branches/eraser6/Manager/DirectExecutor.cs	(revision 915)
@@ -66,9 +66,9 @@
 				if (unusedIds.Count != 0)
 				{
-					task.ID = unusedIds[0];
+					task.Id = unusedIds[0];
 					unusedIds.RemoveAt(0);
 				}
 				else
-					task.ID = ++nextId;
+					task.Id = ++nextId;
 			}
 
@@ -78,5 +78,5 @@
 			//Add the task to the set of tasks
 			lock (tasksLock)
-				tasks.Add(task.ID, task);
+				tasks.Add(task.Id, task);
 
 			//Call all the event handlers who registered to be notified of tasks
@@ -111,5 +111,5 @@
 
 				for (int i = 0; i != scheduledTasks.Count; )
-					if (scheduledTasks.Values[i].ID == taskId)
+					if (scheduledTasks.Values[i].Id == taskId)
 						scheduledTasks.RemoveAt(i);
 					else
@@ -128,12 +128,12 @@
 			{
 				//Replace the task in the global set
-				if (!tasks.ContainsKey(task.ID))
+				if (!tasks.ContainsKey(task.Id))
 					return;
 
-				tasks[task.ID] = task;
+				tasks[task.Id] = task;
 
 				//Then replace the task if it is in the queue
 				for (int i = 0; i != scheduledTasks.Count; ++i)
-					if (scheduledTasks.Values[i].ID == task.ID)
+					if (scheduledTasks.Values[i].Id == task.Id)
 					{
 						scheduledTasks.RemoveAt(i);
@@ -313,13 +313,13 @@
 						//Run the task
 						TaskProgressManager progress = new TaskProgressManager(currentTask);
-						foreach (Task.ErasureTarget target in task.Targets)
+						foreach (ErasureTarget target in task.Targets)
 							try
 							{
 								progress.Event.CurrentTarget = target;
 								++progress.Event.CurrentTargetIndex;
-								if (target is Task.UnusedSpace)
-									EraseUnusedSpace(task, (Task.UnusedSpace)target, progress);
-								else if (target is Task.FilesystemObject)
-									EraseFilesystemObject(task, (Task.FilesystemObject)target, progress);
+								if (target is UnusedSpaceTarget)
+									EraseUnusedSpace(task, (UnusedSpaceTarget)target, progress);
+								else if (target is FileSystemObjectTarget)
+									EraseFilesystemObject(task, (FileSystemObjectTarget)target, progress);
 								else
 									throw new ArgumentException(S._("Unknown erasure target."));
@@ -501,5 +501,5 @@
 			public TaskProgressManager(Task task)
 			{
-				foreach (Task.ErasureTarget target in task.Targets)
+				foreach (ErasureTarget target in task.Targets)
 					Total += target.TotalData;
 
@@ -534,5 +534,5 @@
 		/// <param name="target">The target of the unused space erase.</param>
 		/// <param name="progress">The progress manager object managing the progress of the task</param>
-		private void EraseUnusedSpace(Task task, Task.UnusedSpace target, TaskProgressManager progress)
+		private void EraseUnusedSpace(Task task, UnusedSpaceTarget target, TaskProgressManager progress)
 		{
 			//Check for sufficient privileges to run the unused space erasure.
@@ -702,5 +702,5 @@
 			string currentFilePath, int totalFiles);
 
-		private static void EraseClusterTips(Task task, Task.UnusedSpace target,
+		private static void EraseClusterTips(Task task, UnusedSpaceTarget target,
 			ErasureMethod method, ClusterTipsEraseProgress callback)
 		{
@@ -868,5 +868,5 @@
 		/// <param name="target">The target of the erasure.</param>
 		/// <param name="progress">The progress manager for the current task.</param>
-		private void EraseFilesystemObject(Task task, Task.FilesystemObject target,
+		private void EraseFilesystemObject(Task task, FileSystemObjectTarget target,
 			TaskProgressManager progress)
 		{
@@ -981,10 +981,10 @@
 
 			//If the user requested a folder removal, do it.
-			if (target is Task.Folder)
+			if (target is FolderTarget)
 			{
 				progress.Event.CurrentItemName = S._("Removing folders...");
 				task.OnProgressChanged(progress.Event);
 
-				Task.Folder fldr = (Task.Folder)target;
+				FolderTarget fldr = (FolderTarget)target;
 				if (fldr.DeleteIfEmpty)
 				{
@@ -995,5 +995,5 @@
 
 			//If the user was erasing the recycle bin, clear the bin.
-			if (target is Task.RecycleBin)
+			if (target is RecycleBinTarget)
 			{
 				progress.Event.CurrentItemName = S._("Emptying recycle bin...");
Index: /branches/eraser6/Manager/Schedule.cs
===================================================================
--- /branches/eraser6/Manager/Schedule.cs	(revision 914)
+++ /branches/eraser6/Manager/Schedule.cs	(revision 915)
@@ -172,5 +172,5 @@
 
 		#region Object serialization
-		public RecurringSchedule(SerializationInfo info, StreamingContext context)
+		protected RecurringSchedule(SerializationInfo info, StreamingContext context)
 		{
 			type = (ScheduleUnit)info.GetValue("Type", typeof(ScheduleUnit));
Index: /branches/eraser6/Eraser/Program.cs
===================================================================
--- /branches/eraser6/Eraser/Program.cs	(revision 914)
+++ /branches/eraser6/Eraser/Program.cs	(revision 915)
@@ -794,5 +794,5 @@
 				else if (IsParam(param, "recycled", "r"))
 				{
-					targets.Add(new Task.RecycleBin());
+					targets.Add(new RecycleBinTarget());
 				}
 				else if (IsParam(param, "unused", "u"))
@@ -803,5 +803,5 @@
 
 					//Create the UnusedSpace target for inclusion into the task.
-					Task.UnusedSpace target = new Task.UnusedSpace();
+					UnusedSpaceTarget target = new UnusedSpaceTarget();
 
 					//Determine if cluster tips should be erased.
@@ -825,5 +825,5 @@
 
 					//Create the base target
-					Task.Folder target = new Task.Folder();
+					FolderTarget target = new FolderTarget();
 
 					//Parse the subparameters.
@@ -858,5 +858,5 @@
 				{
 					//It's just a file!
-					Task.File target = new Task.File();
+					FileTarget target = new FileTarget();
 					target.Path = Path.GetFullPath(param);
 					targets.Add(target);
@@ -891,9 +891,9 @@
 			/// The list of targets which was specified on the command line.
 			/// </summary>
-			public List<Task.ErasureTarget> Targets
+			public List<ErasureTarget> Targets
 			{
 				get
 				{
-					return new List<Task.ErasureTarget>(targets.ToArray());
+					return new List<ErasureTarget>(targets.ToArray());
 				}
 			}
@@ -901,5 +901,5 @@
 			private Guid erasureMethod;
 			private Schedule schedule = Schedule.RunNow;
-			private List<Task.ErasureTarget> targets = new List<Task.ErasureTarget>();
+			private List<ErasureTarget> targets = new List<ErasureTarget>();
 		}
 		#endregion
@@ -1086,5 +1086,5 @@
 				ErasureMethodManager.Default :
 				ErasureMethodManager.GetInstance(taskArgs.ErasureMethod);
-			foreach (Task.ErasureTarget target in taskArgs.Targets)
+			foreach (ErasureTarget target in taskArgs.Targets)
 			{
 				target.Method = method;
Index: /branches/eraser6/Eraser/SettingsPanel.cs
===================================================================
--- /branches/eraser6/Eraser/SettingsPanel.cs	(revision 914)
+++ /branches/eraser6/Eraser/SettingsPanel.cs	(revision 915)
@@ -74,6 +74,6 @@
 			item.Checked = instance.Plugin != null ||
 				(Manager.ManagerLibrary.Instance.Settings.PluginApprovals.ContainsKey(
-					instance.AssemblyInfo.GUID) && Manager.ManagerLibrary.Instance.
-					Settings.PluginApprovals[instance.AssemblyInfo.GUID]
+					instance.AssemblyInfo.Guid) && Manager.ManagerLibrary.Instance.
+					Settings.PluginApprovals[instance.AssemblyInfo.Guid]
 				);
 
@@ -363,5 +363,5 @@
 			{
 				PluginInstance plugin = (PluginInstance)item.Tag;
-				Guid guid = plugin.AssemblyInfo.GUID;
+				Guid guid = plugin.AssemblyInfo.Guid;
 				if (!pluginApprovals.ContainsKey(guid))
 				{
Index: /branches/eraser6/Eraser/TaskDataSelectionForm.cs
===================================================================
--- /branches/eraser6/Eraser/TaskDataSelectionForm.cs	(revision 914)
+++ /branches/eraser6/Eraser/TaskDataSelectionForm.cs	(revision 915)
@@ -95,12 +95,12 @@
 		/// <returns>An Eraser.Manager.Task.Data or Eraser.Manager.Task.UnusedSpace object
 		/// or any of its inherited classes, depending on the task selected</returns>
-		public Task.ErasureTarget Target
+		public ErasureTarget Target
 		{
 			get
 			{
-				Task.ErasureTarget result = null;
+				ErasureTarget result = null;
 				if (file.Checked)
 				{
-					Manager.Task.File fileTask = new Task.File();
+					FileTarget fileTask = new FileTarget();
 					result = fileTask;
 
@@ -109,5 +109,5 @@
 				else if (folder.Checked)
 				{
-					Manager.Task.Folder folderTask = new Task.Folder();
+					FolderTarget folderTask = new FolderTarget();
 					result = folderTask;
 
@@ -119,5 +119,5 @@
 				else if (unused.Checked)
 				{
-					Task.UnusedSpace unusedSpaceTask = new Task.UnusedSpace();
+					UnusedSpaceTarget unusedSpaceTask = new UnusedSpaceTarget();
 					result = unusedSpaceTask;
 
@@ -127,5 +127,5 @@
 				else
 				{
-					Task.RecycleBin recycleBinTask = new Task.RecycleBin();
+					RecycleBinTarget recycleBinTask = new RecycleBinTarget();
 					result = recycleBinTask;
 				}
@@ -147,13 +147,13 @@
 
 				//Then the data to be erased.
-				if (value is Task.File)
+				if (value is FileTarget)
 				{
 					file.Checked = true;
-					filePath.Text = ((Task.File)value).Path;
-				}
-				else if (value is Task.Folder)
+					filePath.Text = ((FileTarget)value).Path;
+				}
+				else if (value is FolderTarget)
 				{
 					folder.Checked = true;
-					Manager.Task.Folder folderTask = (Task.Folder)value;
+					FolderTarget folderTask = (FolderTarget)value;
 
 					folderPath.Text = folderTask.Path;
@@ -162,8 +162,8 @@
 					folderDelete.Checked = folderTask.DeleteIfEmpty;
 				}
-				else if (value is Task.UnusedSpace)
+				else if (value is UnusedSpaceTarget)
 				{
 					unused.Checked = true;
-					Task.UnusedSpace unusedSpaceTask = (Task.UnusedSpace)value;
+					UnusedSpaceTarget unusedSpaceTask = (UnusedSpaceTarget)value;
 					foreach (object item in unusedDisk.Items)
 						if (((DriveItem)item).Drive == unusedSpaceTask.Drive)
@@ -171,5 +171,5 @@
 					unusedClusterTips.Checked = unusedSpaceTask.EraseClusterTips;
 				}
-				else if (value is Task.RecycleBin)
+				else if (value is RecycleBinTarget)
 				{
 					recycleBin.Checked = true;
Index: /branches/eraser6/Eraser/SchedulerPanel.cs
===================================================================
--- /branches/eraser6/Eraser/SchedulerPanel.cs	(revision 914)
+++ /branches/eraser6/Eraser/SchedulerPanel.cs	(revision 915)
@@ -270,5 +270,5 @@
 				!(e.Task.Schedule is RecurringSchedule) && highestLevel < LogLevel.Warning)
 			{
-				Program.eraserClient.DeleteTask(e.Task.ID);
+				Program.eraserClient.DeleteTask(e.Task.Id);
 			}
 
@@ -478,5 +478,5 @@
 				Task task = (Task)item.Tag;
 				if (!task.Executing)
-					Program.eraserClient.DeleteTask(task.ID);
+					Program.eraserClient.DeleteTask(task.Id);
 			}
 		}
Index: /branches/eraser6/Eraser/TaskPropertiesForm.cs
===================================================================
--- /branches/eraser6/Eraser/TaskPropertiesForm.cs	(revision 914)
+++ /branches/eraser6/Eraser/TaskPropertiesForm.cs	(revision 915)
@@ -132,5 +132,5 @@
 
 			//The data
-			foreach (Task.ErasureTarget target in task.Targets)
+			foreach (ErasureTarget target in task.Targets)
 			{
 				ListViewItem item = data.Items.Add(target.UIText);
@@ -203,5 +203,5 @@
 				if (form.ShowDialog() == DialogResult.OK)
 				{
-					Task.ErasureTarget target = form.Target;
+					ErasureTarget target = form.Target;
 					ListViewItem item = data.Items.Add(target.UIText);
 					item.SubItems.Add(target.MethodDefined ? target.Method.Name : S._("(default)"));
@@ -228,5 +228,5 @@
 				if (form.ShowDialog() == DialogResult.OK)
 				{
-					Task.ErasureTarget target = form.Target;
+					ErasureTarget target = form.Target;
 					task.Targets[item.Index] = target;
 					item.Text = target.UIText;
@@ -263,5 +263,5 @@
 			foreach (ListViewItem obj in data.SelectedItems)
 			{
-				task.Targets.Remove((Task.ErasureTarget)obj.Tag);
+				task.Targets.Remove((ErasureTarget)obj.Tag);
 				data.Items.Remove(obj);
 			}
