Ejemplo n.º 1
0
        public void Handle(IConsoleAdapter console)
        {
            console.WrapLine("Get user input".BGWhite().Black());
            console.WriteLine();

            var item = console.ReadInput(new {String = Read.String().Prompt("Enter some text".Yellow())});

            var characters = item.String.Value
                .Select(c => string.Format(@"""{0}"" = {1}".Red(),
                    ConsoleIOExtensions.Yellow(c.ToString()),
                    string.Format("{0:X}", (byte) c).PadLeft(2, '0').Green()));

            console.WriteLine();
            console.WrapLine(string.Join("  ", characters));
            console.WriteLine();

            console.ReadLine();
        }
 public void Handle(IConsoleAdapter adapter)
 {
     var item = adapter.ReadInput(new {String = string.Empty, Int = 0});
     adapter.WriteLine();
     if (item == null)
     {
         adapter.WrapLine("Invalid input. No item received.");
     }
     else
     {
         adapter.WrapLine("Input received.");
         adapter.WrapLine("String was \"{0}\", integer was {1}", item.String, item.Int);
     }
 }