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.
		
		
		
		
		
			
		
			
				
					
					
						
							49 lines
						
					
					
						
							1.8 KiB
						
					
					
				
			
		
		
	
	
							49 lines
						
					
					
						
							1.8 KiB
						
					
					
				using KGIS.Framework.Utils; | 
						|
using Kingo.PluginServiceInterface; | 
						|
using System; | 
						|
using System.Xml.Serialization; | 
						|
 | 
						|
namespace Kingo.Plugin.BGSetting.Service | 
						|
{ | 
						|
 | 
						|
    [XmlRoot("config")] | 
						|
    public class SystCfgClass : ISystemCfg | 
						|
    { | 
						|
        public SystemConfig2 SysCfg { get; set; } | 
						|
        public SystemConfig2 Load() | 
						|
        { | 
						|
            string BaseLoadCfg = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs", "SystemCfg.xml"); | 
						|
            if (System.IO.File.Exists(BaseLoadCfg)) | 
						|
            { | 
						|
                SystemConfig2 cfg = SerializeAPI.DeserializeToObject2<SystemConfig2>(BaseLoadCfg); | 
						|
                return cfg; | 
						|
            } | 
						|
            return null; | 
						|
        } | 
						|
 | 
						|
        public void Save() | 
						|
        { | 
						|
            try | 
						|
            { | 
						|
                //string BaseLoadCfg = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs", "SystemCfg.xml"); | 
						|
                //if (System.IO.File.Exists(BaseLoadCfg)) | 
						|
                //{ | 
						|
                //    string cfg = SerializeAPI.SerializeToXML<SystemConfig2>(this); | 
						|
                //} | 
						|
                //SystCfgClass cfg_SystemSetting = new SystCfgClass(); | 
						|
                //cfg_SystemSetting.BaseLoadCfg = this.BaseLoadCfg; | 
						|
                //cfg_SystemSetting.JZCGCfg = this.JZCGCfg; | 
						|
                //string cfg = SerializeAPI.SerializeToXML<SystCfgClass>(cfg_SystemSetting); | 
						|
                //string newSavePath = System.IO.Path.Combine((MapsManager.Instance.CurrProjectInfo as ProjectInfo).ProjDir, "SystemSettingConfig.xml"); | 
						|
                //XmlDocument xmlDoc = new XmlDocument(); | 
						|
                //xmlDoc.LoadXml(cfg); | 
						|
                //xmlDoc.Save(newSavePath); | 
						|
            } | 
						|
            catch (Exception ex) | 
						|
            { | 
						|
                LogAPI.Debug("保存系统配置文件失败:" + ex); | 
						|
            } | 
						|
        } | 
						|
    } | 
						|
 | 
						|
}
 | 
						|
 |