Beispiel #1
0
        static void Main(string[] args)
        {
            CommandPrompt myCommand = new CommandPrompt(16, 38);



            int menuOption;

            int           windowSize = GetNumber("How big do you want your window? ", 60);
            CommandPrompt monitor    = new CommandPrompt(windowSize, 80);

            do
            {
                monitor.Display();
                menuOption = GetNumber(
                    "\t0 - Power\n" +
                    "\t1 - Background Color\t2 - Foreground Color\n" +
                    "\t3 - Screen Text     \t4 - Clear Screen\n" +
                    "\t5 - Save Screen     \t6 - Reload Screen\n" +
                    "\t7 - Display\n" +
                    "Menu Option: ", 8);
                switch (menuOption)
                {
                case 1:
                    monitor.SetBackgroundColor(GetInput("Color? "));
                    break;

                case 2:
                    monitor.SetForegroundColor(GetInput("Color? "));
                    break;

                case 3:
                    int    lineNum = GetNumber("Enter Line Number ", windowSize - 1);
                    string text    = GetInput("? ");
                    monitor.SetScreenText(lineNum, text);
                    break;

                case 4:
                    monitor.ClearScreen();
                    break;

                case 5:
                    monitor.SaveScreen(GetInput("File: "));
                    break;

                case 6:
                    monitor.ReloadScreen(GetInput("File: "));
                    break;

                case 7:
                    monitor.Display();
                    break;

                default:
                    monitor.ClearScreen();
                    break;
                }
            } while (menuOption != 0);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            CommandPrompt myCommand = new CommandPrompt(5, 6);

            myCommand.SetScreenText(2, "This is line 2 text.");
            myCommand.SetScreenText(1, "This is line 1 text.");
            myCommand.SetScreenText(4, "At line 4.");
            myCommand.Display();
            Console.ReadLine();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("MY text **************************");

            int windowSize = 30;
            CommandPrompt monitor = new CommandPrompt(windowSize, 120);

            int menuOption;

            do
            {
                monitor.Display();
                menuOption = GetNumber(
                                  "\t0 - Power\n" +
                                  "\t1 - Background Color\t2 - Foreground Color\n" +
                                  "\t3 - Screen Text     \t4 - Clear Screen\n" +
                                  "\t5 - Save Screen     \t6 - Reload Screen\n" +
                                  "\t7 - Display\n" +
                                  "Menu Option: ", 7);
                switch (menuOption)
                {
                    case 1:
                        monitor.SetBackgroundColor(GetInput("Color? "));
                        break;
                    case 2:
                        monitor.SetForegroundColor(GetInput("Color? "));
                        break;
                    case 3:
                        int lineNum = GetNumber("Enter Line Number ", windowSize - 1);
                        string text = GetInput("? ");
                        monitor.SetScreenText(lineNum, text);
                        break;
                    case 4:
                        monitor.ClearScreen();
                        break;
                    case 5:
                        monitor.SaveScreen("SaveScreen.txt");
                        break;
                    case 6:
                        //                        monitor.ReloadScreen(GetInput("File: SaveScreen.txt") );
                        monitor.ReloadScreen("SaveScreen.txt");
                        monitor.Display();
                        break;
                    case 7:
                        monitor.Display();
                        break;
                    default:
                        monitor.ClearScreen();
                        break;
                }
            } while (menuOption != 0);
        }