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.
		
		
		
		
		
			
		
			
				
					
					
						
							89 lines
						
					
					
						
							3.1 KiB
						
					
					
				
			
		
		
	
	
							89 lines
						
					
					
						
							3.1 KiB
						
					
					
				using KGIS.Framework.Maps; | 
						|
using KGIS.Framework.Platform; | 
						|
using KGIS.Framework.Utils; | 
						|
using KGIS.Framework.Utils.Helper; | 
						|
using Kingo.PluginServiceInterface; | 
						|
using System; | 
						|
using System.Collections.Generic; | 
						|
 | 
						|
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; | 
						|
                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) | 
						|
        { | 
						|
        } | 
						|
    } | 
						|
}
 | 
						|
 |