public Command(string name, CommandCall fn, ConsoleMenu menu) { this.UnpaddedLabel = name; this.Label = name; this.function = fn; this.menu = menu; }
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)); }