using ESRI.ArcGIS.Controls; using KGIS.Framework.Commands; using KGIS.Framework.Utils; using KGIS.Framework.Utils.Helper; using System; using System.Windows.Forms; namespace Kingo.PlatformPlugin.Commands { /// /// 系统退出 /// public class CmdExit : BaseMenuCommand { public IHookHelper m_hookHelper { get; set; } private IEngineEditor m_Editor; public override void OnClick() { try { if (m_Editor.EditState != esriEngineEditState.esriEngineStateNotEditing) { MessageHelper.ShowTips("请先结束编辑操作!"); return; } if (MessageHelper.ShowYesNoAndTips("是否退出系统?") == DialogResult.Yes) { GC.Collect(); Application.Exit(); } } catch (Exception) { throw; } } public override void OnCreate(object Hook) { try { if (m_hookHelper == null) { m_hookHelper = new HookHelper(); m_hookHelper.Hook = Hook; } if (m_Editor == null) m_Editor = new EngineEditorClass(); } catch (Exception ex) { LogAPI.Debug("初始化 退出 命令时异常,异常信息如下:"); LogAPI.Debug(ex); LogAPI.Debug("初始化 退出 命令时异常信息结束"); } } } }