//private TreeNode[] ConvertTreeNodeCollectionToGroup(TreeNodeCollection col) //{ // List<TreeNode> list = new List<TreeNode>(); // for (int i = 0; i < col.Count; i++) // { // list.Add(col[i].Clone() as TreeNode); // } // return list.ToArray(); //} public string CreateNewProjectCanTest(string systemPath, NetWorkType type) { string str = string.Empty; this.m_ProcessBarManager.ShowLoadingForm(); try { IAutoTestFunction iAut = null; if (null != this.m_MainFormUIManager.MainForm.AutoTestManager.AutoTestSubSys) { iAut = this.m_MainFormUIManager.MainForm.AutoTestManager.AutoTestSubSys as IAutoTestFunction; } ProjectLogicMgr.Instance.CreateProject(systemPath, type, iAut); MainFormSingleton.CurrentMainForm.ResourceMrgMenuItem.Visible = false; string templateFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "PrintConfiguration.xml"); this.m_MainFormUIManager.MainForm.PrintConfigCollection = new PrintSettingCollection(templateFile); //print PrintProject.Instance.PrintSeeting = this.m_MainFormUIManager.MainForm.PrintConfigCollection.GetDefaultPrintSetting(); ProjectSingleton.CurrentProject.ProjectSerializeData.PrintSeeting = PrintProject.Instance.PrintSeeting; ProjectSingleton.CurrentProject.ProjectSerializeData.PSCollection = this.m_MainFormUIManager.MainForm.PrintConfigCollection; } catch (Exception) { this.m_ProcessBarManager.CloseLoadingForm(); return(FrameworkResource.PROJECT_CREATEPRJ_FAIL); } finally { this.m_ProcessBarManager.CloseLoadingForm(); } this.BindProject(); this.m_MainFormUIManager.MainForm.SetStatusAfterCreateProject(); //this.StartDsSys(); return(str); }
public bool BindProject() { try { GeneralProjectEntity currentProject = ProjectSingleton.CurrentProject as GeneralProjectEntity; this.LoadProject(currentProject); if (null != this.m_MainFormUIManager.MainForm.AutoTestManager.AutoTestSubSys) { IAutoTestFunction autoTestSubSys = this.m_MainFormUIManager.MainForm.AutoTestManager.AutoTestSubSys as IAutoTestFunction; } this.m_MainFormUIManager.MainForm.MapProject.Add(currentProject.MainForm, currentProject); this.m_MainFormUIManager.MainForm.DockContent = currentProject.MainForm; currentProject.MainForm.Show(this.m_MainFormUIManager.MainForm.DockPanelInstance, DockState.Document); currentProject.DockPanel = this.m_MainFormUIManager.MainForm.DockPanelInstance; IAutoTestExcelProcess service = new XlsDataManager(); currentProject.AppContext.RegisterService(service); currentProject.AppContext.RegisterService(ProjectFileManager.Instance()); } catch (Exception exception) { WriteLog.Logger.Error(exception.StackTrace); } return(true); }