using ESRI.ArcGIS.Controls; using KGIS.Framework.Commands; using KGIS.Framework.Maps; using KGIS.Framework.Platform; using KGIS.Framework.Utils; using KGIS.Framework.Utils.Helper; using Kingo.PluginServiceInterface; using System; namespace Kingo.Plugin.DTBJK.Commands { public class CmdAllTasksList : BaseMenuCommand { public IHookHelper m_hookHelper; public override void OnCreate(object hook) { if (hook == null) { return; } try { if (m_hookHelper == null) { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; } } catch { m_hookHelper = null; return; } } public override void OnClick() { try { ProjectInfo projectInfo = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo; var jcdltb = MapsManager.Instance.MapService.GetFeatureClassByName("DLTB"); if (string.IsNullOrWhiteSpace(projectInfo.JCKPath) && jcdltb == null) { MessageHelper.Show("请先使用“基础数据加载”功能设置基础库数据!"); return; } //if (string.IsNullOrWhiteSpace(projectInfo.UserName)) //{ // MessageHelper.Show("请先使用“用户信息设置”功能设置用户名!"); // return; //} //Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { MsgType = "InitProject" }); Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { Content = SystemTypeEnum.DTBJK, MsgType = "LoadDTBViewData" }); } catch (Exception ex) { LogAPI.Debug("Kingo.Plugin.DTBJK.Commands界面初始化失败" + ex.Message); MessageHelper.ShowError("Kingo.Plugin.DTBJK.Commands界面初始化失败:" + ex.Message); } finally { KGIS.Framework.Platform.Helper.ProgressHelper.CloseProcessBar(); } } public override bool Enabled { get { ProjectInfo projectInfo = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo; if (projectInfo == null) return false; return true; } } } }