年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
1.7 KiB

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
{
/// <summary>
/// 系统退出
/// </summary>
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("初始化 退出 命令时异常信息结束");
}
}
}
}