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.
92 lines
3.4 KiB
92 lines
3.4 KiB
using KGIS.Framework.Utils; |
|
using System; |
|
using Kingo.PluginServiceInterface; |
|
using KGIS.Framework.Utils.Helper; |
|
using System.Collections.Generic; |
|
using KGIS.Framework.Maps; |
|
using KGIS.Framework.Platform; |
|
|
|
namespace Kingo.Plugin.BGSetting.Views |
|
{ |
|
/// <summary> |
|
/// 系统设置 的交互逻辑 |
|
/// </summary> |
|
public partial class UCOpenSystemSet : BaseWindow |
|
{ |
|
public SystemConfig2 SystemCfg { get; set; } |
|
public UCOpenSystemSet() |
|
{ |
|
InitializeComponent(); |
|
|
|
if (Platform.Instance.SystemType == SystemTypeEnum.BGFWCG) |
|
{ |
|
SJJZ.Visibility = System.Windows.Visibility.Collapsed; |
|
WYXX.Visibility = System.Windows.Visibility.Collapsed; |
|
TCZDPZ.Visibility = System.Windows.Visibility.Collapsed; |
|
BGTBJC.Visibility = System.Windows.Visibility.Collapsed; |
|
ZLTBJC.Visibility = System.Windows.Visibility.Collapsed; |
|
XJKZMJ.Visibility = System.Windows.Visibility.Collapsed; |
|
tabControl.SelectedIndex = 5; |
|
} |
|
|
|
ISystemCfg cfg2 = UIShell.OSGi.BundleRuntime.Instance.GetFirstOrDefaultService<ISystemCfg>(); |
|
SystemCfg = cfg2.Load(); |
|
if (SystemCfg.JcLayerLoadCfg == null) |
|
{ |
|
SystemCfg.JcLayerLoadCfg = new List<LayerCfg>(); |
|
} |
|
this.DataContext = this; |
|
if (MapsManager.Instance.CurrProjectInfo != null) |
|
{ |
|
if ((MapsManager.Instance.CurrProjectInfo as ProjectInfo).KZMJ == null) |
|
(MapsManager.Instance.CurrProjectInfo as ProjectInfo).KZMJ = new KZMJInfo(); |
|
CtrlKZMJ.DataContext = (MapsManager.Instance.CurrProjectInfo as ProjectInfo).KZMJ; |
|
} |
|
} |
|
|
|
private void btnCancel_Click(object sender, System.Windows.RoutedEventArgs e) |
|
{ |
|
this.Close(); |
|
} |
|
|
|
/// <summary> |
|
/// 保存按钮 |
|
/// </summary> |
|
/// <param name="sender"></param> |
|
/// <param name="e"></param> |
|
private void btnSave_Click(object sender, System.Windows.RoutedEventArgs e) |
|
{ |
|
try |
|
{ |
|
SystemCfg.Save(); |
|
Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { MsgType = "SaveProject" }); |
|
Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { MsgType = "InitProject" }); |
|
MessageHelper.Show("保存成功!"); |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("保存系统配置文件失败:" + ex); |
|
MessageHelper.Show("系统配置文件保存失败!"); |
|
} |
|
} |
|
|
|
private void btnOK_Click(object sender, System.Windows.RoutedEventArgs e) |
|
{ |
|
try |
|
{ |
|
SystemCfg.Save(); |
|
Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { MsgType = "InitProject" }); |
|
this.Close(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("保存系统配置文件失败:" + ex); |
|
MessageHelper.Show("系统配置文件保存失败!"); |
|
} |
|
} |
|
|
|
private void BaseWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) |
|
{ |
|
} |
|
} |
|
}
|
|
|