Inheritance: ContextAssistPicker
Ejemplo n.º 1
0
        public static void Run()
        {
            // by default, the user can cancel via the escape key
            var result = new StatePickerAssistant().Search();

            // variation that disallows cancellation via the escape key.
            // var result = new StatePickerAssistant().Search(allowCancel: false);

            if (result == null)
            {
                ConsoleString.WriteLine("You cancelled the search", ConsoleColor.Yellow);
            }
            else
            {
                ConsoleString.WriteLine(new ConsoleString("You picked ") + result.DisplayText.ToConsoleString(ConsoleColor.Cyan));
            }
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            // by default, the user can cancel via the escape key
            var result = new StatePickerAssistant().Search();

            // variation that disallows cancellation via the escape key.
            // var result = new StatePickerAssistant().Search(allowCancel: false);

            if (result == null)
            {
                ConsoleString.WriteLine("You cancelled the search", ConsoleColor.Yellow);
            }
            else
            {
                ConsoleString.WriteLine(new ConsoleString("You picked ") + result.DisplayText.ToConsoleString(ConsoleColor.Cyan));
            }
        }