Example #1
0
        /// <summary>
        /// Reads program settings from a json file
        /// </summary>
        private void LoadSettings()
        {
            _settings = _settingReadWrite.ReadSettings();

            CategoryList.SelectedIndex = _settings.RadioCategory;
            VolumeBar.Value            = _settings.VolumeLevel;
            _volumeLevel     = _settings.VolumeLevel;
            VolumeLabel.Text = String.Format("{0} %", _volumeLevel);

            if (_settings.Location.X > 0 && _settings.Location.Y > 0)
            {
                this.Location = _settings.Location;
            }
            this.WindowState = _settings.FormWindowState;
            this.Size        = _settings.Size;
        }
Example #2
0
        /// <summary>
        /// Reads program settings from a json file
        /// </summary>
        private void LoadSettings()
        {
            _settings = _settingReadWrite.ReadSettings();

            CategoryList.SelectedIndex = _settings.RadioCategory;
            VolumeBar.Value = _settings.VolumeLevel;
            _volumeLevel = _settings.VolumeLevel;
            VolumeLabel.Text = String.Format("{0} %", _volumeLevel);

            if (_settings.Location.X > 0 && _settings.Location.Y > 0)
            {
                this.Location = _settings.Location;
            }
            this.WindowState = _settings.FormWindowState;
            this.Size = _settings.Size;
        }
Example #3
0
 public void WriteSettings(Settings settings)
 {
     var jsonStr = JsonConvert.SerializeObject(settings, Formatting.Indented);
     File.WriteAllText(_filePath, jsonStr, Encoding.UTF8);
 }