/// <summary> ///This function is called when executing the action. /// </summary> ///<returns>true, if the action performed successfully</returns> public bool Execute(ActionCallingContext ctx) { try { if (EProjectManager.GetInstance().GetCurrentPrj() == null) { MessageBox.Show("Нет открытого проекта!", "EPlaner", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { ModeFrm.OnSetNewValue OnSetNewValueFunction = null; bool isRebuiltTree = true; ModeFrm.GetInstance().ShowModes( TechObject.TechObjectManager.GetInstance(), false, false, null, null, OnSetNewValueFunction, isRebuiltTree); } } catch (Exception ex) { MessageBox.Show(ex.Message); } return(true); }
/// <summary> /// Сохранить данные и закончить работу с дополнением (при закрытии /// проекта или Eplan). /// </summary> public void SaveAndClose() { SyncAndSave(); StopEditModes(); ExcelRepoter.AutomaticExportExcelForSCADA(currentProject); // Проверка и сохранение состояний окон. ModeFrm.CheckShown(); ModeFrm.SaveCfg(ModeFrm.modeIsShown); DFrm.CheckShown(); DFrm.SaveCfg(DFrm.deviceIsShown); Editor.NewEditorControl.CheckShown(); Editor.NewEditorControl.SaveCfg(); if (Editor.Editor.GetInstance().IsShown()) { Editor.Editor.GetInstance().CloseEditor(); } ModeFrm.GetInstance().CloseEditor(); DFrm.GetInstance().CloseEditor(); }