public TreeNodeAdv AddNewTestCase(TreeNodeAdv parentNode) { TestCaseGroup parentGroup = null; if (parentNode != null) { parentGroup = parentNode.Tag as TestCaseGroup ?? parentNode.Parent.Tag as TestCaseGroup; } if (parentGroup == null) { parentGroup = CoreData.Instance.TestCaseModel.Root; } TestCase newTestCase = CoreData.Instance.TestCaseModel.AddTestCase(parentGroup, "NewTestCase.cs"); return(treeView.FindNodeByTag(newTestCase)); }
/// <summary> /// Gets the <see cref="TreePath"/> of the specified <see cref="ObjectField"/>. /// </summary> /// <param name="field">The <see cref="TreePath"/> of this <see cref="ObjectField"/> is returned.</param> /// <returns>The <see cref="TreePath"/> of the <see cref="ObjectField"/> or <c>null</c> if no <see cref="TreePath"/> could be found.</returns> private TreePath GetPath(ObjectField field) { return(treeView.GetPath(treeView.FindNodeByTag(field))); }