Exemple #1
0
 private static ConsoleMenuItem CreateCircularSelectionMenu(ConsoleMenuBase menu)
 {
     return(new ConsoleMenuItem(
                $"CircularSelection = {menu.CircularSelection}",
                x =>
     {
         x.Menu.CircularSelection = !x.Menu.CircularSelection;
         x.Text = $"CircularSelection = {x.Menu.CircularSelection}";
     }));
 }
Exemple #2
0
 private static ConsoleMenuItem CreateExecuteOnIndexSelectionMenu(ConsoleMenuBase menu)
 {
     return(new ConsoleMenuItem(
                $"ExecuteOnIndexSelection = {menu.ExecuteOnIndexSelection}",
                x =>
     {
         x.Menu.ExecuteOnIndexSelection = !x.Menu.ExecuteOnIndexSelection;
         x.Text = $"ExecuteOnIndexSelection = {x.Menu.ExecuteOnIndexSelection}";
     }));
 }
Exemple #3
0
 private static ConsoleMenuItem CreateSelectorMenu(ConsoleMenuBase menu)
 {
     return(new ConsoleMenuItem(
                "Change selector",
                new ConsoleMenuItem("Disabled", x => x.Menu.Selector = string.Empty),
                new ConsoleMenuItem("Arrow ( => )", x => x.Menu.Selector = "=>"),
                new ConsoleMenuItem("Star ( * )", x => x.Menu.Selector = "*"),
                new ConsoleMenuItem("Big Double ( >> )", x => x.Menu.Selector = ">>"),
                new ConsoleMenuItem("Small Double ( » )", x => x.Menu.Selector = "»"),
                new ConsoleMenuItem(
                    "Enter custom selector",
                    x =>
     {
         Console.WriteLine("Enter selector");
         menu.Selector = Console.ReadLine();
     })));
 }
Exemple #4
0
 private static void HandleCrash(ConsoleMenuBase menu)
 {
     menu.ExecutionError += OnError;
 }