/// <summary> /// Loads config /// </summary> private static void LoadReadoutConfig() { try { SettingHandler handler = SettingHandler.Load("ReadoutsConfig.xml", new Type[] { typeof(ReadoutModuleConfigNode) }); foreach (ReadoutModule readout in readouts) { ReadoutModuleConfigNode r = handler.Get <ReadoutModuleConfigNode>(readout.Name, null); if (r != null) { readout.ValueStyle.normal.textColor = r.Color; } } handler.Save("ReadoutsConfig.xml"); } catch (Exception ex) { MyLogger.Exception(ex); } }
public static void SaveReadoutConfig(ReadoutModule readout) { try { SettingHandler handler = SettingHandler.Load("ReadoutsConfig.xml", new Type[] { typeof(ReadoutModuleConfigNode) }); var r = handler.Get <ReadoutModuleConfigNode>(readout.Name, null); if (r == null) { r = new ReadoutModuleConfigNode(); } r.Name = readout.Name; r.Color = readout.ValueStyle.normal.textColor; handler.Set(r.Name, r); handler.Save("ReadoutsConfig.xml"); } catch (Exception ex) { MyLogger.Exception(ex); } }