Exemple #1
0
        public void Print(bool clearScreen = true)
        {
            var item = ConzapTools.ChooseFromList <T>(Objects, TitleFactory, Style);

            Conzap.ConzapToolHelpers.ClearScreen(clearScreen);
            ConzapTools.PrintObject <T>(item);
        }
Exemple #2
0
        public void Run(string heading = null)
        {
            heading = heading ?? Heading;
            while (true)
            {
                var listItems = MenuItems.Select(ami => ami.Title).ToList();

                ConzapToolHelpers.ClearAndPrintHeading(heading);

                var input = ConzapTools.ChooseFromList(listItems.ToArray()) - 1;

                ConzapTools.ClearScreen();
                var chosenMenuItem = MenuItems[input];
                var value          = chosenMenuItem.Value;
                if (value == "quit")
                {
                    break;
                }
                MenuItems[input].Callback();
            }
        }