森林草原湿地荒漠调查
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.
 
 
 

77 lines
2.1 KiB

using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.DataLoad.View;
using Kingo.PluginServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kingo.Plugin.DataLoad.Commands
{
public class CmdLoadProjectData : BaseMenuCommand
{
private IEngineEditor pEditor = null;
private IHookHelper m_hookHelper = null;
public override void OnClick()
{
if (pEditor.EditState == esriEngineEditState.esriEngineStateEditing)
{
MessageHelper.ShowTips("请先关闭编辑!");
return;
}
try
{
FrmLoadProjectData frmLoadOtherData = new FrmLoadProjectData
{
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
frmLoadOtherData.ShowInMainWindow(true);
}
catch (Exception ex)
{
LogAPI.Debug("辅助功能:" + ex);
}
}
public override void OnCreate(object Hook)
{
if (m_hookHelper == null)
{
m_hookHelper = new HookHelperClass();
}
m_hookHelper.Hook = Hook;
pEditor = new EngineEditorClass();
}
public override bool Enabled
{
get
{
return JudgeIsHaveTargetPath();
}
}
private bool JudgeIsHaveTargetPath()
{
try
{
if (!(MapsManager.Instance.MapService.GetProjectInfo() is ProjectInfo prj))
{
return false;
}
return true;
}
catch (Exception ex)
{
LogAPI.Debug("判定 检测数据加载 按钮是否有效时失败,异常原因: " + ex + " ; ");
return false;
}
}
}
}