12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.IO;
- using BaseLibRWFile;
- namespace HardwareConfig
- {
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public class HardConfigManager :XMLRW<HardConfigManager>
- {
- public string HardConfigFilePath { get; }= $"{GlobalPara.BaseFilePath}\\Config\\HardConfig.xml";
- public List<BaseHardware> HardwareList { get; set; } = new List<BaseHardware>();
- public static HardConfigManager Ins { get; set; } = new HardConfigManager();
- public static HardConfigManager LoadHardConfigFile(string filepath)
- {
- LoadSysSettingConfig();
- return Load(filepath, typeof(HardConfigManager));
- }
- public static void LoadSysSettingConfig()
- {
- string strPath = SysSettingPara.Instance.StrSysSettingFilePath;
- if (File.Exists(strPath))
- {
- SysSettingPara.Instance = ClsXml.XmlConfigReader(strPath, typeof(SysSettingPara)) as SysSettingPara;
- }
- }
- public void Save()
- {
- Save(HardConfigFilePath);
- }
- public override bool CheckIfNormal()
- {
- throw new NotImplementedException();
- }
- }
- }
|