using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using BaseLibRWFile; namespace HardwareConfig { [TypeConverter(typeof(ExpandableObjectConverter))] public class HardConfigManager :XMLRW { public string HardConfigFilePath { get; }= $"{GlobalPara.BaseFilePath}\\Config\\HardConfig.xml"; public List HardwareList { get; set; } = new List(); 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(); } } }