public override void SetValue(bool value) { var toWrite = value ? 1U : 0U; SetFunction(BaseAddress, Kind, toWrite, 2, 1, 1); NotifyOptionChanged(value); // This is a hack to make the native text commands work as expected; do not reuse this // or expect it to work elsewhere. if (Hack) { Marshal.WriteInt32(BaseAddress, Offset - 21504, (int)toWrite); } if (string.IsNullOrEmpty(CfgSetting)) { return; } var cfg = CFG.Load(); if (cfg == null) { return; } cfg.Settings[CfgSection][CfgSetting] = toWrite.ToString(); cfg.Save(); }
public override void SetValue(byte value) { SetFunction(BaseAddress, Kind, value, 2, 1, 1); NotifyOptionChanged(value); if (string.IsNullOrEmpty(CfgSetting)) { return; } var cfg = CFG.Load(); if (cfg == null) { return; } cfg.Settings[CfgSection][CfgSetting] = value.ToString(); cfg.Save(); }