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

69 lines
2.0 KiB

using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Utils;
using Kingo.Plugin.DTBJKLoadData.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kingo.Plugin.DTBJKLoadData.Commands
{
/// <summary>
/// 加载单图斑基础数据库
/// </summary>
public class CmdLoadDTBBaseData : BaseMenuCommand
{
private UCLoadDTBJKData uCLoadDTBJKData { get; set; }
private IHookHelper m_hookHelper { get; set; }
public override void OnClick()
{
try
{
if (uCLoadDTBJKData == null)
{
uCLoadDTBJKData = new UCLoadDTBJKData(m_hookHelper);
uCLoadDTBJKData.Closed += ExportDTBJK_CloseViewHandler;
uCLoadDTBJKData.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
}
uCLoadDTBJKData.ShowInMainWindow(true);
}
catch (Exception ex)
{
LogAPI.Debug(ex.Message);
uCLoadDTBJKData = null;
}
}
public override void OnCreate(object Hook)
{
try
{
if (m_hookHelper == null)
m_hookHelper = new HookHelperClass();
m_hookHelper.Hook = Hook;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
}
}
private void ExportDTBJK_CloseViewHandler(object sender, EventArgs e)
{
try
{
if (uCLoadDTBJKData != null)
{
uCLoadDTBJKData.DataContext = null;
uCLoadDTBJKData = null;
}
}
catch (Exception ex)
{
LogAPI.Debug("单图斑基础数据加载失败:" + ex);
}
}
}
}