public void Start(MouserSettings settings) { _settings = settings; _bActive = true; _timer.Interval = _settings.LoopMilliseconds; _timer.Start(); }
public void Save(MouserSettings settings) { var sJson = JsonConvert.SerializeObject(settings); using (var writer = new StreamWriter(_settingsFilePath)) { writer.Write(sJson); } }
public MouserSettings Load() { MouserSettings settings = null; try { string sJson; using (var reader = new StreamReader(_settingsFilePath)) { sJson = reader.ReadToEnd(); } settings = JsonConvert.DeserializeObject <MouserSettings>(sJson); } catch (FileNotFoundException) { } return(settings ?? new MouserSettings()); }
public void SetSettings(MouserSettings settings) { _settings = settings; }