public void SaveProjectWhenClose(IProject iprj, FormClosingEventArgs a) { DialogResult result; GeneralProjectEntity entity = iprj as GeneralProjectEntity; LockMainForm.Lock(); if (!this.m_MainFormUIManager.MainForm.IsLicClose) { result = MessageBoxUtil.ShowYesNoCancel(FrameworkResource.PROJECT_SAVE, new string[] { entity.Name }); if (DialogResult.Yes == result) { result = ProjectFileManager.Instance().SaveProjectFile() ? DialogResult.OK : DialogResult.Cancel; } if (DialogResult.Cancel == result) { a.Cancel = true; } } else { result = MessageBoxUtil.ShowYesNo(FrameworkResource.PROJECT_SAVE, new string[] { entity.Name }); if (DialogResult.Yes == result) { ProjectFileManager.Instance().SaveProjectFile(); } } LockMainForm.Unlock(); }
public static ProjectFileManager Instance() { if (m_Instance == null) { m_Instance = new ProjectFileManager(); } return(m_Instance); }
private void SaveAs_Click(object sender, EventArgs e) { if (ProjectFileManager.Instance().SaveAsProjectFile()) { string projectIPLFile = ProjectSingleton.CurrentProject.ProjectIPLFile; this.m_MainFormUIManager.RecentFileUIManager.AddRecentFileItem(projectIPLFile, this.m_fileMenuItem); this.m_RecentFileServiceLogicMgr.UpdateRecentFilesXML(projectIPLFile); } this.m_MainFormUIManager.SetRecentlyPrjEnable(false, this.FileMenuItem); }
private void InitGlobeProjectServices() { ProjectLogicMgr.Instance.GlobeServices.Add(this.m_EVService); ProjectLogicMgr.Instance.GlobeServices.Add(this.m_MainForm.StatusBarServiceInstance); ProjectLogicMgr.Instance.GlobeServices.Add(ProjectFileManager.Instance()); ProjectLogicMgr.Instance.GlobeServices.Add(this.m_MainForm.MainFormService); ProjectLogicMgr.Instance.GlobeServices.Add(PrintProject.Instance); ProjectLogicMgr.Instance.GlobeServices.Add(PrintProject.Instance); ProjectLogicMgr.Instance.GlobeServices.Add(PrintProject.Instance); ProjectLogicMgr.Instance.GlobeServices.Add(new ProcessBarUIMrg()); ProjectLogicMgr.Instance.GlobeServices.Add(this.m_ProjectUIManager); }
private void OrderTreeView() { if (ProjectFileManager.Instance().PrjSerializeData.TreeTypeToTreeNodeListDic != null) { foreach (KeyValuePair <ProjectExplorerTree, List <object> > pair in ProjectFileManager.Instance().PrjSerializeData.TreeTypeToTreeNodeListDic) { List <object> orderList = pair.Value; ProjectExplorerTree key = pair.Key; TreeView tv = ProjectSingleton.CurrentProject.Query(key) as TreeView; this.OrderTreeView(orderList, tv); } } }
private void OpenProject(string filePath) { try { string fileName = Path.GetFileName(filePath); if (!ProjectFileManager.Instance().CheckProjectFileName(fileName)) { MessageBoxUtil.ShowWarning(FrameworkResource.ROJECT_FILE_ERROR, new string[] { fileName }); } else if (this.DeserializeProject(filePath)) { this.m_MainFormUIManager.RecentFileUIManager.AddRecentFileItem(filePath, this.m_MainFormUIManager.MainForm.FileMenuItem); this.m_MainFormUIManager.MainForm.RecentFileServiceLogicMgr.UpdateRecentFilesXML(filePath); this.m_MainFormUIManager.SetRecentlyPrjEnable(false, this.m_MainFormUIManager.MainForm.FileMenuItem); } } catch (Exception exception) { WriteLog.Logger.Error(exception.StackTrace); } }
public string OpenProjectIpLFile(string fileName) { LockMainForm.Lock(); string str = string.Empty; try { this.m_ProcessBarManager.ShowLoadingForm(); GeneralProjectEntity prjEntity = ProjectFileManager.Instance().OpenProjectFile(fileName) as GeneralProjectEntity; if (null == prjEntity) { this.m_ProcessBarManager.CloseLoadingForm(); return(ProjectFileManager.Instance().LastErrMsg); } this.OrderTreeView(); this.BindProject(); this.OpenIPLAutoLoadData(prjEntity); prjEntity.MainForm.TabText = prjEntity.Name; prjEntity.ProjectIPLFile = fileName; prjEntity.NeedPromptSave = false; this.m_MainFormUIManager.SetRecentlyPrjEnable(false, this.m_MainFormUIManager.MainForm.FileMenuItem); this.m_MainFormUIManager.MainForm.SwitchFrameWorkStatus(true); this.m_MainFormUIManager.MainForm.PrintConfigCollection = ProjectFileManager.Instance().PrjSerializeData.PSCollection; PrintProject.Instance.PrintSeeting = ProjectFileManager.Instance().PrjSerializeData.PrintSeeting; } catch (Exception exception) { str = FrameworkResource.PROJECT_LOAD_FAIL; WriteLog.Logger.Error("Open Project Failed: " + exception.StackTrace + "\nMessage:" + exception.Message); ProjectFileManager.Instance().UnlockProjectFile(fileName); return(str); } finally { this.m_ProcessBarManager.CloseLoadingForm(); LockMainForm.Unlock(); } 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); }
public bool SaveCurrentProject() { this.SaveTreeNodeOrder(ProjectSingleton.CurrentProject.ProjectSerializeData.TreeTypeToTreeNodeListDic, this.m_MainFormUIManager.MainForm.PrjExpFrm); return(ProjectFileManager.Instance().SaveProjectFile()); }
private bool ProjectIsOpened(string projectName) { return(ProjectFileManager.Instance().ProjectIsOpened(projectName)); }