public int CheckInput(string uncheckedString) { int checkedString; ConsoleReadWrite readWrite = new ConsoleReadWrite(); while (!int.TryParse(uncheckedString, out checkedString)) { Console.WriteLine("Incorrect type, try again"); readWrite.ShowMenu(); uncheckedString = Console.ReadLine(); } return(checkedString); }
static void Main(string[] args) { ConsoleReadWrite readWrite = new ConsoleReadWrite(); readWrite.RunMenu(); }