private void selectButton_Click(object sender, EventArgs e) { bool userHasSelectedComponentType = playbackComponentRadioButton.Checked || chargerRadioButton.Checked || removableStorageRadioButton.Checked || simCardRadioButton.Checked; if (userHasSelectedComponentType) { RichTextBoxOutput RichTextBoxOutput = new RichTextBoxOutput(outputOfSettingAndRunningComponentRichTextBox); TextBoxInput TextBoxInput = new TextBoxInput(chosenComponentTypeIndex); SimCorpMobile simCorpMobile = new SimCorpMobile(RichTextBoxOutput); PhoneComponentsHandler phoneComponentsHandler = new PhoneComponentsHandler(output: RichTextBoxOutput, input: TextBoxInput); if (playbackComponentRadioButton.Checked) { phoneComponentsHandler.GetAndProcessUserSelectionOfPlayback(simCorpMobile); } if (chargerRadioButton.Checked) { phoneComponentsHandler.GetAndProcessUserSelectionOfCharger(simCorpMobile); } if (removableStorageRadioButton.Checked) { phoneComponentsHandler.GetAndProcessUserSelectionOfStorage(simCorpMobile); } if (simCardRadioButton.Checked) { phoneComponentsHandler.GetAndProcessUserSelectionOfSimCard(simCorpMobile); } } }
static void Main(string[] args) { ConsoleOutput ConsoleOutput = new ConsoleOutput(); ConsoleInput ConsoleInput = new ConsoleInput(); SimCorpMobile SimCorpMobile = new SimCorpMobile(ConsoleOutput); PhoneComponentsHandler phoneComponentsHandler = new PhoneComponentsHandler(output: ConsoleOutput, input: ConsoleInput); phoneComponentsHandler.SelectAndSetComponents(SimCorpMobile); Console.ReadKey(); }