コード例 #1
0
        public SubMenu(HogwartsMethods hogwarts, ICharactersDAO charactersDAO)
        {
            this.hogwarts      = hogwarts;
            this.charactersDAO = charactersDAO;
            AddOption("1. Hogwarts, A History", GetHHistory);
            AddOption("2. List of Harry Potter Characters", HPList);
            AddOption("3. Search for Characters by House", ByHouse);

            Configure(cfg =>
            {
                cfg.ItemForegroundColor         = ConsoleColor.Gray;
                cfg.SelectedItemForegroundColor = ConsoleColor.Blue;
            });
        }
コード例 #2
0
        public MainMenu(HogwartsMethods hogwarts, ICharactersDAO charactersDAO, IStudentDAO studentDAO)
        {
            this.hogwarts      = hogwarts;
            this.charactersDAO = charactersDAO;
            this.studentDAO    = studentDAO;
            AddOption("1. Get Sorted", GetSorted);
            AddOption("2. About Hogwarts", SubMenu);
            AddOption("3. Add New Student", AddStudent);
            AddOption("4. Look Up Classmates", LookUpClass);
            AddOption("Exit", Exit);

            Configure(cfg =>
            {
                Console.ForegroundColor = ConsoleColor.DarkGray;
                cfg.Title = FiggleFonts.Ogre.Render("Hogwarts");
                cfg.ItemForegroundColor         = ConsoleColor.Gray;
                cfg.SelectedItemForegroundColor = ConsoleColor.Blue;
            });
        }