Esempio n. 1
0
 public Command(string name, CommandCall fn, ConsoleMenu menu)
 {
     this.UnpaddedLabel = name;
     this.Label         = name;
     this.function      = fn;
     this.menu          = menu;
 }
Esempio n. 2
0
 public void AddSubMenu(string label, ConsoleMenu subMenu, bool addBackAction = true, string backActionLabel = "Back")
 {
     if (addBackAction)
     {
         subMenu.AddCommand(backActionLabel, (m) =>
         {
             m.Exit();
         });
     }
     commands.Add(new Command(label, (m) =>
     {
         m.Exit();
         subMenu.Show();
         m.Show();
     }, this));
 }