Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private void BindToolStripPanel(GeneralProjectEntity project)
 {
     foreach (FloatingToolStrip strip in project.ToolStrips)
     {
         strip.TSPanel = this.m_MainFormUIManager.MainForm.DynamicToolPanel;
         this.m_MainFormUIManager.MainForm.DynamicToolPanel.Join(strip);
     }
 }
Exemplo n.º 3
0
 private void BindToolStripPanel(GeneralProjectEntity project)
 {
     foreach (FloatingToolStrip strip in project.ToolStrips)
     {
         strip.TSPanel = this.m_MainFormUIManager.MainForm.DynamicToolPanel;
         this.m_MainFormUIManager.MainForm.DynamicToolPanel.Join(strip);
     }
 }
Exemplo n.º 4
0
 private void BindMenuStripPanel(GeneralProjectEntity project)
 {
     foreach (IMenuItemOperation operation in project.MenuItems)
     {
         ToolStripMenuItemBase topMenuItem = this.m_MainFormUIManager.MainForm.GetTopMenuItem(operation.MenuItemType);
         if (MenuItemType.File == operation.MenuItemType)
         {
             topMenuItem.DropDownItems.Insert(topMenuItem.DropDownItems.IndexOf(this.m_MainFormUIManager.MainForm.PropertyMenuItem), operation.ToolMenuItem);
         }
         else
         {
             topMenuItem.DropDownItems.Add(operation.ToolMenuItem);
         }
     }
 }
Exemplo n.º 5
0
 private void BindMenuStripPanel(GeneralProjectEntity project)
 {
     foreach (IMenuItemOperation operation in project.MenuItems)
     {
         ToolStripMenuItemBase topMenuItem = this.m_MainFormUIManager.MainForm.GetTopMenuItem(operation.MenuItemType);
         if (MenuItemType.File == operation.MenuItemType)
         {
             topMenuItem.DropDownItems.Insert(topMenuItem.DropDownItems.IndexOf(this.m_MainFormUIManager.MainForm.PropertyMenuItem), operation.ToolMenuItem);
         }
         else
         {
             topMenuItem.DropDownItems.Add(operation.ToolMenuItem);
         }
     }
 }
Exemplo n.º 6
0
        public void LoadProject(IProject iprj)
        {
            GeneralProjectEntity project = iprj as GeneralProjectEntity;

            ProjectSingleton.CurrentProject = project;
            if (null != this.m_MainFormUIManager.MainForm.AutoTestManager.AutoTestSubSys)
            {
                this.m_MainFormUIManager.MainForm.AutoTestManager.AutoTestSubSys.InitStage2();
            }
            this.m_MainFormUIManager.InitPrjExpFrmTreeView(ProjectExplorerTree.Edit);
            this.m_MainFormUIManager.InitPrjExpFrmTreeView(ProjectExplorerTree.Geo);
            this.m_MainFormUIManager.InitPrjExpFrmTreeView(ProjectExplorerTree.Home);
            this.m_MainFormUIManager.InitPrjExpFrmTreeView(ProjectExplorerTree.Wizard);
            this.m_MainFormUIManager.MainForm.PrjExpFrm.tabControl.LoadTabPage();
            this.BindToolStripPanel(project);
            this.BindMenuStripPanel(project);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
0
 public void ChangeProjectName(GeneralProjectEntity GeneralProjectEntity)
 {
     GeneralProjectEntity.MainForm.TabText = GeneralProjectEntity.Name;
 }
Exemplo n.º 10
0
 public void ChangeProjectName(GeneralProjectEntity GeneralProjectEntity)
 {
     GeneralProjectEntity.MainForm.TabText = GeneralProjectEntity.Name;
 }