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

62 lines
1.9 KiB

using KGIS.Framework.Commands;
using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using Kingo.Plugin.MapView.Views.AppMenuView;
using Kingo.PluginServiceInterface;
using System;
namespace Kingo.Plugin.MapView.Commands
{
public class CmdUserInfoSetting : BaseMenuCommand
{
private UCProjectInfoSetting ProjectInfoSetting { get; set; }
public override void OnClick()
{
try
{
if (ProjectInfoSetting == null)
{
ProjectInfoSetting = new UCProjectInfoSetting
{
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
ProjectInfoSetting.Closed += Main_Closed;
ProjectInfoSetting.ShowInMainWindow(false);
}
}
catch (Exception ex)
{
LogAPI.Debug("用户信息设置界面初始化异常,异常信息如下:");
LogAPI.Debug(ex);
LogAPI.Debug("异常信息结束。");
KGIS.Framework.Utils.Helper.MessageHelper.ShowError("用户信息设置界面初始化异常:" + ex.Message);
}
}
private void Main_Closed(object sender, EventArgs e)
{
try
{
if (ProjectInfoSetting != null)
{
ProjectInfoSetting.Close();
}
ProjectInfoSetting = null;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
}
}
public override void OnCreate(object Hook)
{
}
public override bool Enabled
{
get
{
return (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo) == null ? false : true;
}
}
}
}