/// <summary> /// Collapse a specified menu-entry within the tree. /// </summary> /// <param name="treeitem">TreeItem to collapse</param> /// <returns> /// <br>True: If call worked fine</br> /// <br>False: If an error occurred</br> /// </returns> public bool CollapseMenu(TreeItem treeitem) { try { if (treeitem.Expanded) { treeitem.Collapse(); } return(true); } catch (Exception exception) { Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), exception.Message); return(false); } }
bool StartProcess() { try { Reports.ReportLog("Preconditions-Started", Reports.ADSReportLevel.Success, null, Configuration.Config.TestCaseName); TreeItem server = Preconditions.Steps.GetServerTreeFromTCName(Config.TestCaseName); Preconditions.Steps.SelectedServerTreeItem = server; Preconditions.Steps.SelectedServerName = server.Text; server.RightClickThis(); Preconditions.Steps.ConnectServer(); if (server.Items.Count > 1) { Preconditions.Steps.QueryAnalyser(); Preconditions.Steps.CreateDatabase(); Preconditions.Steps.CloseTab(server.Text); Preconditions.Steps.QueryAnalyser(); if (Config.SchemaServers.Contains(server.Text)) { Preconditions.Steps.SelectSchemaDBFromComboBox(Config.ADSDB); } else { Preconditions.Steps.SelectDBFromComboBox(Config.ADSDB); } Preconditions.Steps.CreateTable(); Preconditions.Steps.CloseTab(server.Text); Preconditions.Steps.isPreconditionDone = true; Reports.ReportLog("Preconditions-Completed", Reports.ADSReportLevel.Success, null, Configuration.Config.TestCaseName); } else { // Log failed due to Server down server.Collapse(); Preconditions.Steps.isPreconditionDone = false; } } catch (Exception ex) { Preconditions.Steps.isPreconditionDone = false; Reports.ReportLog(ex.Message, Reports.ADSReportLevel.Fail, null, Configuration.Config.TestCaseName); } return(true); }