/// <summary> /// Shows a dialog asking to choose a single sound from SoundBank. /// If no sound is chosen, returns null, else returns sound name. /// </summary> /// <returns></returns> public static string ChooseSound() { FormChooseSound ChooseSoundUI = new FormChooseSound(); if (ChooseSoundUI.ShowDialog() == System.Windows.Forms.DialogResult.OK) { return ChooseSoundUI.ChosenSound; } else return null; }
private void buttonChooseSound_Click(object sender, EventArgs e) { FormChooseSound ChooseSoundUI = new FormChooseSound(); if (ChooseSoundUI.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ParentModule.Settings.Value.SoundName = ChooseSoundUI.ChosenSound; textBoxChosenSound.Text = ParentModule.Settings.Value.SoundName; ParentModule.Settings.DelayedSave(); } }
//button click in ui public void SetQueueSound() { FormChooseSound ChooseSoundUI = new FormChooseSound(); if (ChooseSoundUI.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Settings.Value.QueueSoundName = ChooseSoundUI.ChosenSound; SoundManagerUI.UpdateSoundName(Settings.Value.QueueSoundName); Settings.DelayedSave(); } }