年度变更建库软件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.
 
 

65 lines
2.1 KiB

using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.PluginServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UIShell.OSGi;
namespace Kingo.Plugin.BHTB_Extract.Commands
{
public class CmdBHTBResult : BaseMenuCommand
{
IEngineEditor m_pEditor = null;
IBGResultFormHelper frmGCDataToSHPGTY = null;
public override void OnClick()
{
if (m_pEditor.EditState == esriEngineEditState.esriEngineStateEditing)
{
MessageHelper.ShowTips("请先关闭编辑!");
return;
}
IFeatureLayer BHTBLayer = MapsManager.Instance.MapService.GetFeatureLayerByName("JCTB");
if (BHTBLayer != null)
{
frmGCDataToSHPGTY = BundleRuntime.Instance.GetFirstOrDefaultService<IBGResultFormHelper>();
if (frmGCDataToSHPGTY != null)
{
frmGCDataToSHPGTY.InitView(BHTBLayer);
}
}
}
public override void OnCreate(object Hook)
{
m_pEditor = new EngineEditorClass();
}
public override bool Enabled => JudgeIsHaveTargetPath();
private bool JudgeIsHaveTargetPath()
{
try
{
IFeatureLayer BHTBLayer = MapsManager.Instance.MapService.GetFeatureLayerByName("JCTB");
if (!(MapsManager.Instance.MapService.GetProjectInfo() is ProjectInfo prj) || BHTBLayer == null)
{
return false;
}
return m_pEditor.EditState == esriEngineEditState.esriEngineStateNotEditing;
}
catch (Exception ex)
{
LogAPI.Debug("判定 变化图斑导出 按钮是否有效时失败,异常原因: " + ex + " ; ");
return false;
}
}
}
}