Beispiel #1
0
        public IReadTextResultWrapper ReadLineWithOptions()
        {
            string readText   = Console.ReadLine();
            var    readResult = new ReadTextResult(readText);

            return(new ReadTextResultWrapper(readResult, this));
        }
Beispiel #2
0
        private IReadTextResultWrapper ReadLineAsParsedWithOptions(Func <string, bool> parseMethod, string retryText = "")
        {
            while (true)
            {
                string readText = Console.ReadLine();

                if (parseMethod(readText))
                {
                    var readResult = new ReadTextResult(readText);
                    return(new ReadTextResultWrapper(readResult, this));
                }
                else if (!string.IsNullOrEmpty(retryText))
                {
                    WriteText(retryText);
                }
            }
        }
Beispiel #3
0
 internal ReadTextResultWrapper(ReadTextResult readResult, Consolefy fluentConsole)
 {
     _possibleOutcomes = new List <PossibleReadTextOutcome>();
     _readResult       = readResult;
     _fluentConsole    = fluentConsole;
 }