/// <summary>
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="taskNodeToInitialize"/> is <see langword="null"/>.
        /// </exception>
        protected virtual void InitializeTask(NuGenTaskTreeNode taskNodeToInitialize)
        {
            if (taskNodeToInitialize == null)
            {
                throw new ArgumentNullException("taskNodeToInitialize");
            }

            Debug.Assert(this.ImageListService != null, "this.ImageListService != null");
            Debug.Assert(this.ImageList != null, "this.ImageList != null");

            taskNodeToInitialize.SetPriorityImageIndex(
                NuGenTaskPriority.Critical,
                this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_CRITICAL)
                );

            taskNodeToInitialize.SetPriorityImageIndex(
                NuGenTaskPriority.Maybe,
                this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_MAYBE)
                );

            taskNodeToInitialize.SetPriorityImageIndex(
                NuGenTaskPriority.Required,
                this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_REQUIRED)
                );

            taskNodeToInitialize.SetPriorityImageIndex(
                NuGenTaskPriority.Wanted,
                this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_WANTED)
                );

            taskNodeToInitialize.SetPriorityImageIndex(
                NuGenTaskPriority.WouldBeNice,
                this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_WOULDBENICE)
                );
        }
        /// <summary>
        /// </summary>
        /// <param name="taskText"></param>
        public void AddTask(string taskText)
        {
            NuGenTaskTreeNode taskNode = new NuGenTaskTreeNode(this.ServiceProvider, taskText);

            this.InitializeTask(taskNode);
            this.AddTask(taskNode);
        }
        /// <summary>
        /// </summary>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="taskNodeToAdd"/> is <see langword="null"/>.
        /// </exception>
        public void AddTask(NuGenTaskTreeNode taskNodeToAdd)
        {
            if (taskNodeToAdd == null)
            {
                throw new ArgumentNullException("taskNodeToAdd");
            }

            NuGenTaskTreeNodeBase selectedNode = (NuGenTaskTreeNodeBase)this.SelectedNode;

            if (
                selectedNode is NuGenFolderTreeNode &&
                selectedNode.IsRemovable
                )
            {
                selectedNode.Nodes.AddNode(taskNodeToAdd);
            }
            else if (
                selectedNode != null &&
                selectedNode.Parent != null
                )
            {
                if (
                    selectedNode.Parent is NuGenTaskTreeNodeBase &&
                    ((NuGenTaskTreeNodeBase)selectedNode.Parent).IsRemovable
                    )
                {
                    selectedNode.Parent.Nodes.AddNode(taskNodeToAdd);
                }
                else
                {
                    this.Nodes.AddNode(taskNodeToAdd);
                }
            }
            else
            {
                this.Nodes.AddNode(taskNodeToAdd);
            }

            this.SelectedNode = taskNodeToAdd;
            this.OnTaskAdded(EventArgs.Empty);
            this.OnEventToBeDelayed(new NuGenTaskAddedEventArgs(taskNodeToAdd.Text));
        }
        /// <summary>
        /// </summary>
        /// <param name="xmlNodeToLoadFrom"></param>
        /// <param name="parentNodeCollection"></param>
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="xmlNodeToLoadFrom"/> is <see langword="null"/>.
        /// -or-
        /// <paramref name="parentNodeCollection"/> is <see langword="null"/>.
        /// </exception>
        protected void LoadNode(XmlNode xmlNodeToLoadFrom, NuGenTreeNodeCollection parentNodeCollection)
        {
            if (xmlNodeToLoadFrom == null)
            {
                throw new ArgumentNullException("xmlNodeToLoadFrom");
            }

            if (parentNodeCollection == null)
            {
                throw new ArgumentNullException("parentNodeCollection");
            }

            NuGenTaskTreeNodeBase treeNodeToAdd = null;

            if (xmlNodeToLoadFrom.Name == Resources.XmlTag_Folder)
            {
                treeNodeToAdd = new NuGenFolderTreeNode(this.ServiceProvider);
                this.InitializeFolder((NuGenFolderTreeNode)treeNodeToAdd);
            }
            else if (xmlNodeToLoadFrom.Name == Resources.XmlTag_Task)
            {
                treeNodeToAdd = new NuGenTaskTreeNode(this.ServiceProvider);
                this.InitializeTask((NuGenTaskTreeNode)treeNodeToAdd);
            }
            else
            {
                return;
            }

            parentNodeCollection.AddNode(treeNodeToAdd);
            treeNodeToAdd.Load(xmlNodeToLoadFrom);

            foreach (XmlNode childNode in xmlNodeToLoadFrom.ChildNodes)
            {
                this.LoadNode(childNode, treeNodeToAdd.Nodes);
            }
        }
		/// <summary>
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="taskNodeToInitialize"/> is <see langword="null"/>.
		/// </exception>
		protected virtual void InitializeTask(NuGenTaskTreeNode taskNodeToInitialize)
		{
			if (taskNodeToInitialize == null)
			{
				throw new ArgumentNullException("taskNodeToInitialize");
			}

			Debug.Assert(this.ImageListService != null, "this.ImageListService != null");
			Debug.Assert(this.ImageList != null, "this.ImageList != null");

			taskNodeToInitialize.SetPriorityImageIndex(
				NuGenTaskPriority.Critical,
				this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_CRITICAL)
			);

			taskNodeToInitialize.SetPriorityImageIndex(
				NuGenTaskPriority.Maybe,
				this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_MAYBE)
			);

			taskNodeToInitialize.SetPriorityImageIndex(
				NuGenTaskPriority.Required,
				this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_REQUIRED)
			);

			taskNodeToInitialize.SetPriorityImageIndex(
				NuGenTaskPriority.Wanted,
				this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_WANTED)
			);

			taskNodeToInitialize.SetPriorityImageIndex(
				NuGenTaskPriority.WouldBeNice,
				this.ImageListService.GetImageIndex(this.ImageList, PRIORITY_WOULDBENICE)
			);
		}
		/// <summary>
		/// </summary>
		/// <param name="xmlNodeToLoadFrom"></param>
		/// <param name="parentNodeCollection"></param>
		/// <exception cref="T:System.ArgumentNullException">
		/// <paramref name="xmlNodeToLoadFrom"/> is <see langword="null"/>.
		/// -or-
		/// <paramref name="parentNodeCollection"/> is <see langword="null"/>.
		/// </exception>
		protected void LoadNode(XmlNode xmlNodeToLoadFrom, NuGenTreeNodeCollection parentNodeCollection)
		{
			if (xmlNodeToLoadFrom == null)
			{
				throw new ArgumentNullException("xmlNodeToLoadFrom");
			}

			if (parentNodeCollection == null)
			{
				throw new ArgumentNullException("parentNodeCollection");
			}

			NuGenTaskTreeNodeBase treeNodeToAdd = null;

			if (xmlNodeToLoadFrom.Name == Resources.XmlTag_Folder)
			{
				treeNodeToAdd = new NuGenFolderTreeNode(this.ServiceProvider);
				this.InitializeFolder((NuGenFolderTreeNode)treeNodeToAdd);
			}
			else if (xmlNodeToLoadFrom.Name == Resources.XmlTag_Task)
			{
				treeNodeToAdd = new NuGenTaskTreeNode(this.ServiceProvider);
				this.InitializeTask((NuGenTaskTreeNode)treeNodeToAdd);
			}
			else
			{
				return;
			}

			parentNodeCollection.AddNode(treeNodeToAdd);
			treeNodeToAdd.Load(xmlNodeToLoadFrom);

			foreach (XmlNode childNode in xmlNodeToLoadFrom.ChildNodes)
			{
				this.LoadNode(childNode, treeNodeToAdd.Nodes);
			}
		}
		/// <summary>
		/// </summary>
		/// <param name="taskText"></param>
		public void AddTask(string taskText)
		{
			NuGenTaskTreeNode taskNode = new NuGenTaskTreeNode(this.ServiceProvider, taskText);
			this.InitializeTask(taskNode);
			this.AddTask(taskNode);
		}
		/// <summary>
		/// </summary>
		/// <exception cref="T:System.ArgumentNullException">
		/// <paramref name="taskNodeToAdd"/> is <see langword="null"/>.
		/// </exception>
		public void AddTask(NuGenTaskTreeNode taskNodeToAdd)
		{
			if (taskNodeToAdd == null)
			{
				throw new ArgumentNullException("taskNodeToAdd");
			}

			NuGenTaskTreeNodeBase selectedNode = (NuGenTaskTreeNodeBase)this.SelectedNode;

			if (
				selectedNode is NuGenFolderTreeNode
				&& selectedNode.IsRemovable
				)
			{
				selectedNode.Nodes.AddNode(taskNodeToAdd);
			}
			else if (
				selectedNode != null
				&& selectedNode.Parent != null
				)
			{
				if (
					selectedNode.Parent is NuGenTaskTreeNodeBase
					&& ((NuGenTaskTreeNodeBase)selectedNode.Parent).IsRemovable
					)
				{
					selectedNode.Parent.Nodes.AddNode(taskNodeToAdd);
				}
				else
				{
					this.Nodes.AddNode(taskNodeToAdd);
				}
			}
			else
			{
				this.Nodes.AddNode(taskNodeToAdd);
			}

			this.SelectedNode = taskNodeToAdd;
			this.OnTaskAdded(EventArgs.Empty);
			this.OnEventToBeDelayed(new NuGenTaskAddedEventArgs(taskNodeToAdd.Text));
		}
		private void PopulateTaskTreeView()
		{
			NuGenTaskTreeNode task = new NuGenTaskTreeNode(
				this._ServiceProvider,
				this._TaskText,
				this._TaskPriority
			);

			task.Text = this._TaskText;
			task.Checked = true;

			NuGenTaskTreeNode task2 = new NuGenTaskTreeNode(
				this._ServiceProvider,
				this._Task2Text,
				this._Task2Priority
			);

			task2.Text = this._Task2Text;

			NuGenFolderTreeNode folder = new NuGenFolderTreeNode(
				this._ServiceProvider,
				this._FolderText
			);

			folder.Text = this._FolderText;

			NuGenTaskTreeNode folderChild = new NuGenTaskTreeNode(
				this._ServiceProvider,
				this._FolderChildText,
				this._FolderChildPriority
			);

			folderChild.Checked = true;
			folderChild.Text = this._FolderChildText;
			folder.Nodes.AddNode(folderChild);

			this._TaskTreeView.Nodes.AddNodeRange(new NuGenTreeNode[] { task, task2, folder });
		}