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 { /// /// 系统设置 的交互逻辑 /// 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(); SystemCfg = cfg2.Load(); if (SystemCfg.JcLayerLoadCfg == null) { SystemCfg.JcLayerLoadCfg = new List(); } 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(); } /// /// 保存按钮 /// /// /// 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) { } } }