예제 #1
0
        private static void DisplayMenu()
        {
            ScrollMenu scrollMenu = new ScrollMenu()
            {
                Margin = 7,
                HorizontalAlignment = DustInTheWind.ConsoleTools.HorizontalAlignment.Center,
                EraseAfterClose     = true
            };

            scrollMenu.AddItems(new IMenuItem[]
            {
                new LabelMenuItem
                {
                    Text    = "New Game",
                    Command = new NewGame(SuperPlay)
                },
                //new YesNoMenuItem
                //{
                //    Text = "Save Game",
                //    Command = new SaveGameCommand(SaveGameToDb,  _gameProg)
                //},
                new LabelMenuItem
                {
                    Text    = "Load&Play",
                    Command = new LoadGameCommand(LoadGameList)
                },
                new LabelMenuItem
                {
                    Text    = "Show Score",
                    Command = new ShowScoreMenu(ShowScore)
                },
                new LabelMenuItem
                {
                    Text    = "  Exit  ",
                    Command = new ExitGame(ExitGame)
                }
            });

            scrollMenu.Display();
        }
예제 #2
0
        public static void MenuOne(string[] options)
        {
            ScrollMenu scrollMenu = new ScrollMenu();

            scrollMenu.HorizontalAlignment = HorizontalAlignment.Left;
            Console.WriteLine("\n\n\n\n\t BIENVENIDO AL VIDEOCLUB\n");
            for (int i = 0; i < options.Length; i++)
            {
                scrollMenu.AddItem(new LabelMenuItem()
                {
                    IsEnabled           = true,
                    IsVisible           = true,
                    Text                = options[i],
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    PaddingLeft         = 9,
                    PaddingRight        = 30 - options[i].Length,
                    ShortcutKey         = ShortCut(i),
                    Command             = new Opcion1Command(i)
                });
            }
            scrollMenu.Display();
        }
예제 #3
0
        public static void MenuTwo(string[] menu, int j)
        {
            Console.Clear();
            ScrollMenu scrollMenu = new ScrollMenu();

            scrollMenu.HorizontalAlignment = HorizontalAlignment.Left;
            Console.WriteLine($"\n\n\n\n\t BIENVENIDO AL VIDEOCLUB {Service.User.Nombre}\n");
            for (int i = 0; i < menu.Length; i++)
            {
                if (j == 0)
                {
                    scrollMenu.AddItem(new LabelMenuItem()
                    {
                        IsEnabled           = true,
                        IsVisible           = true,
                        Text                = menu[i],
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        PaddingLeft         = 9,
                        PaddingRight        = 30 - menu[i].Length,
                        ShortcutKey         = ShortCut(i),
                        Command             = new Opcion2Command(i)
                    });
                }
                else if (j == 1)
                {
                    scrollMenu.AddItem(new LabelMenuItem()
                    {
                        IsEnabled           = true,
                        IsVisible           = true,
                        Text                = menu[i],
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        PaddingLeft         = 9,
                        PaddingRight        = 30 - menu[i].Length,
                        ShortcutKey         = ShortCut(i),
                        Command             = new Opcion3Command(i)
                    });
                }
                else if (j == 2)
                {
                    scrollMenu.AddItem(new LabelMenuItem()
                    {
                        IsEnabled           = true,
                        IsVisible           = true,
                        Text                = menu[i],
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        PaddingLeft         = 9,
                        PaddingRight        = 30 - menu[i].Length,
                        ShortcutKey         = ShortCut(i),
                        Command             = new Opcion4Command(i)
                    });
                }
                else if (j == 3)
                {
                    scrollMenu.AddItem(new LabelMenuItem()
                    {
                        IsEnabled           = true,
                        IsVisible           = true,
                        Text                = menu[i],
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        PaddingLeft         = 9,
                        PaddingRight        = 30 - menu[i].Length,
                        ShortcutKey         = ShortCut(i),
                        Command             = new Opcion5Command(i)
                    });
                }
            }

            scrollMenu.Display();
        }