/// <summary>
        /// A new test class has been added to the project so a new
        /// tree node is added if the class belongs to this namespace.
        /// </summary>
        void TestClassAdded(object source, TestClassEventArgs e)
        {
            if (e.TestClass.Namespace == fullNamespace)
            {
                // Add test class to our monitored test classes.
                testClasses.Add(e.TestClass);

                // Add a new tree node.
                TestClassTreeNode classNode = new TestClassTreeNode(TestProject, e.TestClass);
                classNode.AddTo(this);

                // Sort the nodes.
                SortChildNodes();
            }
            else if (isInitialized && NamespaceStartsWith(e.TestClass.Namespace))
            {
                // Check if there is a child namespace node for the class.
                string childNamespace = TestClass.GetChildNamespace(e.TestClass.Namespace, fullNamespace);
                if (!NamespaceNodeExists(childNamespace))
                {
                    // Add a new namespace node.
                    TestNamespaceTreeNode node = new TestNamespaceTreeNode(TestProject, fullNamespace, childNamespace);
                    node.AddTo(this);

                    // Sort the nodes.
                    SortChildNodes();
                }
            }
        }
		/// <summary>
		/// Removes the corresponding tree node that is a child of
		/// this project tree node if the class has no root namespace.
		/// </summary>
		void TestClassRemoved(object source, TestClassEventArgs e)
		{
			if (e.TestClass.Namespace == String.Empty) {
				foreach (ExtTreeNode node in Nodes) {
					TestClassTreeNode classNode = node as TestClassTreeNode;
					if (classNode != null && classNode.Text == e.TestClass.Name) {
						classNode.Remove();
						classNode.Dispose();
						break;
					}
				}
			}
		}
		/// <summary>
		/// Adds a new class node to this project node if the
		/// class added has no root namespace.
		/// </summary>
		void TestClassAdded(object source, TestClassEventArgs e)
		{
			if (e.TestClass.Namespace == String.Empty) {
				AddClassNode(e.TestClass);
				SortChildNodes();
			} else if (isInitialized) {
				// Check that we have a namespace node for this class.
				if (!NamespaceNodeExists(e.TestClass.RootNamespace)) {
					// Add a new namespace node.
					TestNamespaceTreeNode node = new TestNamespaceTreeNode(TestProject, e.TestClass.RootNamespace);
					node.AddTo(this);
					SortChildNodes();
				}
			}
		}
		/// <summary>
		/// Adds a new class node to this project node if the
		/// class added has no root namespace.
		/// </summary>
		void TestClassAdded(object source, TestClassEventArgs e)
		{
			if (e.TestClass.Namespace == String.Empty) {
				AddClassNode(e.TestClass);
				SortChildNodes();
			} else if (isInitialized) {
				// Check that we have a namespace node for this class.
				if (!NamespaceNodeExists(e.TestClass.RootNamespace)) {
					// Add a new namespace node.
					TestNamespaceTreeNode node = new TestNamespaceTreeNode(TestProject, e.TestClass.RootNamespace);
					node.AddTo(this);
					SortChildNodes();
				}
			}
		}
        /// <summary>
        /// A test class has been removed from the project so the
        /// corresponding tree node is removed if it belongs to this
        /// namespace.
        /// </summary>
        void TestClassRemoved(object source, TestClassEventArgs e)
        {
            if (e.TestClass.Namespace == fullNamespace)
            {
                // Remove test class from our monitored test classes.
                testClasses.Remove(e.TestClass);

                // Remove the corresponding tree node.
                foreach (ExtTreeNode node in Nodes)
                {
                    TestClassTreeNode classNode = node as TestClassTreeNode;
                    if (classNode != null && classNode.Text == e.TestClass.Name)
                    {
                        classNode.Remove();
                        classNode.Dispose();
                        break;
                    }
                }

                // Remove this namespace node if there are no more child nodes.
                RemoveIfEmpty();
            }
        }
		/// <summary>
		/// Removes the corresponding tree node that is a child of
		/// this project tree node if the class has no root namespace.
		/// </summary>
		void TestClassRemoved(object source, TestClassEventArgs e)
		{
			if (e.TestClass.Namespace == String.Empty) {
				foreach (ExtTreeNode node in Nodes) {
					TestClassTreeNode classNode = node as TestClassTreeNode;
					if (classNode != null && classNode.Text == e.TestClass.Name) {
						classNode.Remove();
						classNode.Dispose();
						break;
					}
				}
			}
		}
		void TestClassRemoved(object source, TestClassEventArgs e)
		{
			classesRemoved.Add(e.TestClass);
		}
		/// <summary>
		/// A test class has been removed from the project so the
		/// corresponding tree node is removed if it belongs to this 
		/// namespace.
		/// </summary>
		void TestClassRemoved(object source, TestClassEventArgs e)
		{
			if (e.TestClass.Namespace == fullNamespace) {
				// Remove test class from our monitored test classes.
				testClasses.Remove(e.TestClass);
			
				// Remove the corresponding tree node.
				foreach (ExtTreeNode node in Nodes) {
					TestClassTreeNode classNode = node as TestClassTreeNode;
					if (classNode != null && classNode.Text == e.TestClass.Name) {
						classNode.Remove();
						classNode.Dispose();
						break;
					}
				}
				
				// Remove this namespace node if there are no more child nodes.
				RemoveIfEmpty();
			}
		}
		/// <summary>
		/// A new test class has been added to the project so a new 
		/// tree node is added if the class belongs to this namespace.
		/// </summary>
		void TestClassAdded(object source, TestClassEventArgs e)
		{
			if (e.TestClass.Namespace == fullNamespace) {
				// Add test class to our monitored test classes.
				testClasses.Add(e.TestClass);
				
				// Add a new tree node.
				TestClassTreeNode classNode = new TestClassTreeNode(TestProject, e.TestClass);
				classNode.AddTo(this);
				
				// Sort the nodes.
				SortChildNodes();
			} else if (isInitialized && NamespaceStartsWith(e.TestClass.Namespace)) {
				// Check if there is a child namespace node for the class.
				string childNamespace = TestClass.GetChildNamespace(e.TestClass.Namespace, fullNamespace);
				if (!NamespaceNodeExists(childNamespace)) {
					// Add a new namespace node.
					TestNamespaceTreeNode node = new TestNamespaceTreeNode(TestProject, fullNamespace, childNamespace);
					node.AddTo(this);
					
					// Sort the nodes.
					SortChildNodes();
				}
			}
		}