private void Apply_Click(object sender, EventArgs e) { textOutput.Clear(); var selected = Playback.SelectedValue; HeadSetTypes selectedType; if (!Enum.TryParse(selected.ToString(), out selectedType)) { MessageBox.Show("Try again", "Parsing error:", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { textOutput.Text = $"{selectedType.ToString()} playback selected"; textOutput.Text += Environment.NewLine; textOutput.Text += "Set playback to Mobile..."; textOutput.Text += Environment.NewLine; textOutput.Text += "Play sound in Mobile:"; textOutput.Text += Environment.NewLine; IPlayback headSetPlay = GetPlaybackType(selectedType); headSetPlay.Display(textOutput); } }