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

66 lines
1.9 KiB

using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.LocationChange.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kingo.Plugin.LocationChange.Commands
{
/// <summary>
/// 坐落信息变更
/// </summary>
public class CmdLocationChange : BaseMenuCommand
{
public IHookHelper HookHelper { get; set; }
public FrmLocationChange frmLocationChange = null;
public override void OnClick()
{
try
{
if (frmLocationChange == null)
{
frmLocationChange = new FrmLocationChange
{
Width = 500,
Height = 420,
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
frmLocationChange.Closed += FrmLocationChange_Closed;
}
frmLocationChange.ShowInMainWindow(true);
}
catch (Exception ex)
{
MessageHelper.ShowError("坐落变更初始化失败:" + ex.Message);
LogAPI.Debug(ex);
}
}
public override void OnCreate(object Hook)
{
if (HookHelper == null)
{
HookHelper = new HookHelperClass();
}
HookHelper.Hook = Hook;
}
private void FrmLocationChange_Closed(object sender, EventArgs e)
{
if (frmLocationChange != null)
frmLocationChange = null;
}
public override bool Enabled
{
get
{
return KGIS.Framework.Maps.MapsManager.Instance.MapService.GetProjectInfo() == null ? false : true;
}
}
}
}