/// <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> /// 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(); } }