using KGIS.Framework.Commands;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Dialog;
using Kingo.Plugin.MapView.Views.AppMenuView;
using Kingo.PluginServiceInterface;
using System;
using UIShell.OSGi;
namespace Kingo.Plugin.MapView.Commands
{
///
/// 工作目录-功能点
///
public class CmdSetWorkspace : BaseMenuCommand
{
IWorkCatalog _workCatalog = null;
//测试项
UCSetWorkCatalog uCSetWorkCatalog = null;
public override void OnClick()
{
try
{
if (uCSetWorkCatalog == null)
{
uCSetWorkCatalog = new UCSetWorkCatalog
{
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
uCSetWorkCatalog.Closed += UCSetWorkCatalog_Closed;
}
uCSetWorkCatalog.ShowInMainWindow(true);
//获取公共服务接口
_workCatalog = BundleRuntime.Instance.GetFirstOrDefaultService();
}
catch (Exception ex)
{
LogAPI.Debug("打开工作目录失败:" + ex.Message);
}
}
private void UCSetWorkCatalog_Closed(object sender, EventArgs e)
{
try
{
if (uCSetWorkCatalog != null)
uCSetWorkCatalog = null;
}
catch (Exception ex)
{
LogAPI.Debug("在设置工作目录时发生异常,异常信息如下:" + ex.Message);
}
}
public override void OnCreate(object Hook)
{
}
}
}