private void GetUsersChoisenSalon(string userSalon) { bool _isAnswerIncorrect = true; int nr = 0; do { switch (userSalon) { case "1": btn.MessageEncoded += autoGidas.RichTextBox_LinkClicked; btn.DoubleClick(autoGidas.Url); _car = factory.CreateCarShop(SalonTypes.AutoGidas); _car.Start(); _isAnswerIncorrect = false; break; case "2": btn.MessageEncoded += nissan.RichTextBox_LinkClicked; btn.DoubleClick(nissan.Url); _car = factory.CreateCarShop(SalonTypes.Peugeot_Salon); _car.Start(); _isAnswerIncorrect = false; break; case "3": btn.MessageEncoded += toyota.RichTextBox_LinkClicked; btn.DoubleClick(toyota.Url); _car = factory.CreateCarShop(SalonTypes.Toyota_Salon); _car.Start(); _isAnswerIncorrect = false; break; default: if (!Int32.TryParse(userSalon, out nr)) { throw new Exception("Input is incorrect format! Please, enter a number: 1, 2 or 3."); } Console.WriteLine("This choice doesn't exist! Please, try again!"); userSalon = Console.ReadLine(); break; } }while (_isAnswerIncorrect); Console.WriteLine("\nPlease, enter a link of car model you have chosen:"); string userUrl = Console.ReadLine(); bool isincorrect = true; while (isincorrect) { try { GetModelInfo(userSalon, userUrl); isincorrect = false; } catch (Exception ex) { Console.WriteLine(ex.Message); userUrl = Console.ReadLine(); } } // GetModelInfo(userSalon); }