using ESRI.ArcGIS.Controls; using KGIS.Framework.Commands; using Kingo.Plugin.AttributeMaintain.View; using System; namespace Kingo.Plugin.AttributeMaintain.Commands { /// /// 属性维护 /// public class CmdAttributeMaintain : BaseMenuCommand { public IHookHelper HookHelper { get; set; } private FrmAttributeMaintain frmAttributeMaintain = null; public override void OnClick() { if (frmAttributeMaintain == null) { frmAttributeMaintain = new FrmAttributeMaintain { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen }; frmAttributeMaintain.Closed += FrmAttributeMaintain_Closed; } frmAttributeMaintain.ShowInMainWindow(true); } public override void OnCreate(object Hook) { if (HookHelper == null) { HookHelper = new HookHelperClass(); } HookHelper.Hook = Hook; } private void FrmAttributeMaintain_Closed(object sender, EventArgs e) { if (frmAttributeMaintain != null) frmAttributeMaintain = null; } public override bool Enabled { get { return KGIS.Framework.Maps.MapsManager.Instance.MapService.GetProjectInfo() == null ? false : true; } } } }