Esempio n. 1
0
        private void Settings_Load(object sender, EventArgs e)
        {
            if (!File.Exists(_savePath))
            {
                return;
            }

            try
            {
                var config = JsonConvert.DeserializeObject <SettingsObj>(File.ReadAllText(_savePath));
                try
                {
                    _font = FontSerializationHelper.Deserialize(config.Font);
                }
                catch (Exception)
                {
                    // ignored
                }
                try
                {
                    cbxGradientType.SelectedIndex = config.GradientType;
                    btnColor1.BackColor           = config.Color1;
                    btnColor2.BackColor           = config.Color2;
                    btnBorderColor.BackColor      = config.BorderColor;
                }
                catch (Exception)
                {
                    // ignored
                }
            }
            catch (Exception)
            {
                // ignored
            }
        }
 private void Settings_Load(object sender, EventArgs e)
 {
     try
     {
         _font = FontSerializationHelper.Deserialize(_settings.Font);
     }
     catch (Exception)
     {
         // ignored
     }
     try
     {
         cbxGradientType.SelectedIndex = _settings.GradientType;
         btnColor1.BackColor           = _settings.Color1;
         btnColor2.BackColor           = _settings.Color2;
         btnBorderColor.BackColor      = _settings.BorderColor;
         checkBoxPreserveSlash.Checked = _settings.PreserveSlash;
         checkBoxAutoHide.Checked      = _settings.AutoHide;
     }
     catch (Exception)
     {
         // ignored
     }
 }