示例#1
0
 private void BtnOK_Click(object sender, EventArgs e)
 {
     var settings = new Settings
     {
         LiveForever = ChkLiveForever.Checked,
         ShowDebugInfo = ChkShowDebugInfo.Checked,
         NumOfEnemiesPerSecond = TbEnemyGenFreq.Value,
         FullScreen = ChkFullScreen.Checked,
         NumOfLasersPerSecond = TbLaserGenFreq.Value,
         BgmSoundEffect = ((BackgroundMusicItem)CbBackgroundMusic.SelectedItem).SoundEffect
     };
     Settings.SaveSettings(settings);
     this.DialogResult = DialogResult.OK;
     Close();
 }
示例#2
0
 public static void SaveSettings(Settings settings)
 {
     File.WriteAllText(SettingsFile, JsonConvert.SerializeObject(settings));
 }