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

107 lines
3.0 KiB

using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.Controls;
using KGIS.Framework.Utils.Helper;
using KGIS.Framework.Utils.Interface;
using Kingo.Plugin.ResultsOfProof.View;
using System;
using KGIS.Framework.Maps;
using Kingo.PluginServiceInterface;
namespace Kingo.Plugin.ResultsOfProof.Commands
{
public class JZCGImportCommand : BaseCommand
{
private IHookHelper hookHelper = null;
public override void OnCreate(object hook)
{
if (hookHelper == null)
{
hookHelper = new HookHelperClass();
}
hookHelper.Hook = hook;
}
public override void OnClick()
{
try
{
//KGIS.Framework.Common.Utils.LicenseManager.License();
}
catch
{ }
IEngineEditor pEditor = new EngineEditorClass();
if (pEditor.EditState == esriEngineEditState.esriEngineStateEditing)
{
MessageHelper.ShowTips("请先关闭编辑!");
return;
}
IFeatureLayer pJZFeatureLayer = MapsManager.Instance.MapService.GetFeatureLayerByName("JCTB");
if (pJZFeatureLayer == null || pJZFeatureLayer.FeatureClass == null)
{
MessageHelper.ShowTips("未找到举证成果图层!");
return;
}
FrmJZCGImport main = new FrmJZCGImport(hookHelper);
main.Closed += main_Closed;
main.Width = 600;
main.Height = 215;
main.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
main.Left = 240;
main.Top = 110;
main.Title = "导入举证成果";
main.ShowInMainWindow(false);
}
void main_Closed(object sender, EventArgs e)
{
}
public event Action<NotifyMsgPackage> NotifyMsgEven;
public void SetNotifyMsg(NotifyMsgPackage msg)
{
try
{
if (NotifyMsgEven != null)
NotifyMsgEven(msg);
}
catch (Exception ex)
{
MessageHelper.ShowError(ex.Message);
}
}
public override string Caption
{
get
{
return "举证成果导入";
}
}
public override bool Enabled
{
get
{
if (!(MapsManager.Instance.MapService.GetProjectInfo() is ProjectInfo pTemp))
{
return false;
}
else
{
if (string.IsNullOrWhiteSpace(pTemp.DBPath))
{
return false;
}
else
{
return true;
}
}
}
}
}
}