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.
99 lines
2.9 KiB
99 lines
2.9 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 |
|
{ |
|
/// <summary> |
|
/// 合库成果导出 |
|
/// </summary> |
|
public class HKExportCommand : BaseMenuCommand |
|
{ |
|
private EngineEditorClass pEditor = null; |
|
public IHookHelper m_hookHelper; |
|
private FrmHKExport frmHKExport = null; |
|
public override void OnClick() |
|
{ |
|
try |
|
{ |
|
if (pEditor == null) |
|
{ |
|
pEditor = new EngineEditorClass(); |
|
} |
|
if (pEditor.EditState != esriEngineEditState.esriEngineStateNotEditing) |
|
{ |
|
MessageHelper.ShowTips("请先关闭编辑!"); |
|
return; |
|
} |
|
frmHKExport = new FrmHKExport |
|
{ |
|
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen |
|
}; |
|
frmHKExport.ShowInMainWindow(true); |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("合库成果导出失败" + ex.Message); |
|
MessageHelper.ShowError("合库成果导出失败,可能的原因是:" + ex.Message); |
|
} |
|
} |
|
|
|
public override void OnCreate(object Hook) |
|
{ |
|
if (Hook == null) |
|
{ |
|
return; |
|
} |
|
try |
|
{ |
|
if (m_hookHelper == null) |
|
{ |
|
m_hookHelper = new HookHelperClass |
|
{ |
|
Hook = Hook |
|
}; |
|
} |
|
if (pEditor == null) |
|
{ |
|
pEditor = new EngineEditorClass(); |
|
} |
|
} |
|
catch |
|
{ |
|
m_hookHelper = null; |
|
return; |
|
} |
|
} |
|
|
|
/// <summary> |
|
/// 是否功能展示 |
|
/// </summary> |
|
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 !string.IsNullOrWhiteSpace(pTemp.ZLDatabase) && pEditor.EditState == esriEngineEditState.esriEngineStateNotEditing; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|