/// <summary> /// The get new feature. /// </summary> /// <param name="parent"> /// The parent. /// </param> /// <param name="testObject"> /// The test object. /// </param> /// <param name="isChecked"> /// The is Checked. /// </param> /// <returns> /// The <see cref="ScriptExplorerItem"/>. /// </returns> private ScriptExplorerItem AddNewScriptExplorerItem(ScriptExplorerItem parent, TestObject testObject, bool isChecked) { Log.Enter(this, MethodBase.GetCurrentMethod().Name); var parameterDescription = this.GetParameterDescription(testObject); var testType = this.GetTestType(testObject); var contextMenu = this.GetContextMenu(); var description = !string.IsNullOrEmpty(testObject.Description) ? testObject.Description.Replace("\r\n", " ") : string.Empty; var childFeature = new ScriptExplorerItem(testObject.Name, parameterDescription, description, false, testType, isChecked, false, testObject, contextMenu, true, testObject.ToolTip); if (parent != null) { parent.Children.Add(childFeature); parent.IsExpanded = true; } if (testObject is TestCollection) { var testFolder = testObject as TestCollection; foreach (var child in testFolder.TestObjects) { this.AddNewScriptExplorerItem(childFeature, child, false); } } return(childFeature); }
/// <summary> /// The copy tree item. /// </summary> public void CopyTreeItem() { Log.Enter(this, MethodBase.GetCurrentMethod().Name); var testScript = GetSelectedTestSuite(this.ScriptExplorerModel.ScriptExplorerList); this.testSuiteItemCopy = CopyTestSuite(testScript); }
/// <summary> /// The copy feature. /// </summary> /// <param name="oldTestSuite"> /// The old Test Suite. /// </param> /// <returns> /// The <see cref="TestSuite"/>. /// </returns> private static ScriptExplorerItem CopyTestSuite(ScriptExplorerItem oldTestSuite) { var newTestSuite = oldTestSuite.Copy(); newTestSuite.Parent = null; newTestSuite.HasFocus = false; newTestSuite.IsInFocusChain = false; return(newTestSuite); }