Esempio n. 1
0
        public void Start(MouserSettings settings)
        {
            _settings = settings;

            _bActive = true;

            _timer.Interval = _settings.LoopMilliseconds;
            _timer.Start();
        }
Esempio n. 2
0
        public void Save(MouserSettings settings)
        {
            var sJson = JsonConvert.SerializeObject(settings);

            using (var writer = new StreamWriter(_settingsFilePath))
            {
                writer.Write(sJson);
            }
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
 public void SetSettings(MouserSettings settings)
 {
     _settings = settings;
 }