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.
60 lines
1.7 KiB
60 lines
1.7 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.Plugin.DataCheck.Views; |
|
using Kingo.PluginServiceInterface; |
|
using System; |
|
|
|
namespace Kingo.Plugin.DataCheck.Commands |
|
{ |
|
public class DataCheckCommand : BaseMenuCommand |
|
{ |
|
private IHookHelper hookHelper = null; |
|
public override void OnCreate(object hook) |
|
{ |
|
if (hookHelper == null) |
|
{ |
|
hookHelper = new HookHelperClass(); |
|
} |
|
hookHelper.Hook = hook; |
|
} |
|
FrmDataCheckHelp frmdatachck = null; |
|
public override void OnClick() |
|
{ |
|
try |
|
{ |
|
if (frmdatachck == null || !frmdatachck.IsVisible) |
|
{ |
|
frmdatachck = new FrmDataCheckHelp(hookHelper); |
|
frmdatachck.Closed += Frmdatachck_Closed; |
|
} |
|
frmdatachck.ShowInMainForm(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("初始化数据检查悬浮按钮异常:" + ex); |
|
} |
|
} |
|
|
|
private void Frmdatachck_Closed(object sender, EventArgs e) |
|
{ |
|
frmdatachck = null; |
|
} |
|
|
|
public override bool Enabled |
|
{ |
|
get |
|
{ |
|
ProjectInfo prj = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo; |
|
if (prj == null) |
|
{ |
|
return false; |
|
} |
|
return !string.IsNullOrWhiteSpace(prj.BGDatabase); |
|
} |
|
} |
|
} |
|
}
|
|
|