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.
74 lines
2.1 KiB
74 lines
2.1 KiB
using ESRI.ArcGIS.Controls; |
|
using KGIS.Framework.Commands; |
|
using KGIS.Framework.Maps; |
|
using KGIS.Framework.Utils; |
|
using KGIS.Framework.Utils.Helper; |
|
using Kingo.Plugin.BGResultManager.View; |
|
using Kingo.PluginServiceInterface; |
|
using System; |
|
|
|
namespace Kingo.Plugin.BGResultManager.Commands |
|
{ |
|
public class YBGCGResultExportCommand : BaseMenuCommand |
|
{ |
|
private IHookHelper m_hookHelper = null; |
|
|
|
public override void OnCreate(object hook) |
|
{ |
|
if (hook == null) |
|
{ |
|
return; |
|
} |
|
try |
|
{ |
|
if (m_hookHelper == null) |
|
{ |
|
m_hookHelper = new HookHelperClass(); |
|
m_hookHelper.Hook = hook; |
|
} |
|
} |
|
catch |
|
{ |
|
m_hookHelper = null; |
|
return; |
|
} |
|
} |
|
public override void OnClick() |
|
{ |
|
try |
|
{ |
|
FrmResultsExportForTheYBGCG frm = new FrmResultsExportForTheYBGCG(); |
|
frm.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; |
|
frm.ShowInMainWindow(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("预变更成果导出失败" + ex.Message); |
|
MessageHelper.ShowError("预变更成果导出失败,可能的原因是:" + ex.Message); |
|
} |
|
} |
|
|
|
public override bool Enabled |
|
{ |
|
get |
|
{ |
|
ProjectInfo pTemp = (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo); |
|
if (pTemp == null) |
|
{ |
|
return false; |
|
} |
|
else |
|
{ |
|
if (string.IsNullOrWhiteSpace(pTemp.GetProjFilePath())) |
|
{ |
|
return false; |
|
} |
|
else |
|
{ |
|
return true; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|