|
|
|
|
using ESRI.ArcGIS.ADF.BaseClasses;
|
|
|
|
|
using ESRI.ArcGIS.Carto;
|
|
|
|
|
using ESRI.ArcGIS.Controls;
|
|
|
|
|
using KGIS.Framework.Platform;
|
|
|
|
|
using KGIS.Framework.Utils;
|
|
|
|
|
using KGIS.Framework.Utils.Helper;
|
|
|
|
|
using KGIS.Framework.Maps;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Kingo.Plugin.NYYP.View;
|
|
|
|
|
using KGIS.Framework.Commands;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Kingo.Plugin.NYYP.Commands
|
|
|
|
|
{
|
|
|
|
|
public class CmdYWTBYP : BaseMenuCommand
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private UCYWTBYPList ucYWTBYPList = null;
|
|
|
|
|
private IHookHelper m_hookHelper = null;
|
|
|
|
|
public override void OnCreate(object hook)
|
|
|
|
|
{
|
|
|
|
|
if (m_hookHelper == null)
|
|
|
|
|
{
|
|
|
|
|
m_hookHelper = new HookHelperClass();
|
|
|
|
|
}
|
|
|
|
|
m_hookHelper.Hook = hook;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnClick()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
IFeatureLayer pYWTBFeatureLayer = MapsManager.Instance.MapService.GetFeatureLayerByName("YWTB");
|
|
|
|
|
if (pYWTBFeatureLayer == null || pYWTBFeatureLayer.FeatureClass == null)
|
|
|
|
|
{
|
|
|
|
|
MessageHelper.ShowTips("未找到疑问图斑图层!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (pYWTBFeatureLayer.FeatureClass.FeatureCount(null) == 0)
|
|
|
|
|
{
|
|
|
|
|
KGIS.Framework.Utils.Helper.MessageHelper.ShowTips("疑问图斑表数据为空,请先导入疑问图斑数据!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ucYWTBYPList != null)
|
|
|
|
|
{
|
|
|
|
|
if (ucYWTBYPList != null)
|
|
|
|
|
ucYWTBYPList.CloseDetailView();
|
|
|
|
|
ucYWTBYPList.ClosePanel();
|
|
|
|
|
ucYWTBYPList = null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ucYWTBYPList == null)
|
|
|
|
|
{
|
|
|
|
|
ucYWTBYPList = new UCYWTBYPList(m_hookHelper);
|
|
|
|
|
ucYWTBYPList.CloseViewHandler += UCYWTBYPList_CloseViewHandler;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ucYWTBYPList.ShowPanel();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogAPI.Debug("在初始化 疑问图斑判读 命令时异常,异常信息如下:");
|
|
|
|
|
LogAPI.Debug(ex);
|
|
|
|
|
LogAPI.Debug("在初始化 疑问图斑判读 命令时异常信息结束");
|
|
|
|
|
m_hookHelper = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UCYWTBYPList_CloseViewHandler(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (ucYWTBYPList != null)
|
|
|
|
|
{
|
|
|
|
|
ucYWTBYPList.DataContext = null;
|
|
|
|
|
ucYWTBYPList = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Enabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|