internal static string ReadLine(Action method, ETypeRead typeRead, int optionMaxValue = 0) { var text = Console.ReadLine(); CheckExit(text); if (string.IsNullOrEmpty(text)) { text = "invalid"; } switch (typeRead) { case ETypeRead.String: break; case ETypeRead.Int: text = CheckInvalidNumber(text); break; case ETypeRead.YesOrNo: text = CheckInvalidYesOrNo(text); break; case ETypeRead.NumberList: text = CheckInvalidNumberList(text, optionMaxValue); break; default: break; } if (text == "invalid" && method != null) { method(); } return(text); }
internal static string ReadMany(string text, ETypeRead typeRead) { string input; AddLine(1); do { WriteSameLine(text); input = MenuStructure.ReadLine(null, typeRead); } while (input == "invalid"); return(input); }