public virtual T ReadUntilCorrect(T?min = null, T?max = null) { while (true) { try { return(Read(min, max)); } catch (ConsoleInputException ciex) { ConsoleWrite.Error(ciex.Message); } } }
public virtual T ReadUntilCorrect(Func <T> FunctionToRun, string message = "") { while (true) { try { return(FunctionToRun()); } catch (ConsoleInputException) { if (!string.IsNullOrEmpty(message)) { ConsoleWrite.Error(message); } } } }