Exemple #1
0
        private static void OvnerMenu()
        {
            //Console.OutputEncoding = System.Text.Encoding.GetEncoding(1251);
            View.OwnerMenu();
            while (true)
            {
                Console.SetCursorPosition(40, 15);
                switch (Console.ReadKey().Key)
                {
                case ConsoleKey.Escape:
                    return;

                case ConsoleKey.D1:
                    path       = "English-Ukrainian.xml";
                    vocabulary = SerializeVocabularu.LoadVocab(path);
                    SecondMenu(path, vocabulary);
                    break;

                case ConsoleKey.D2:
                    path       = "Ukrainian-English.xml";
                    vocabulary = SerializeVocabularu.LoadVocab(path);
                    SecondMenu(path, vocabulary);
                    break;

                case ConsoleKey.NumPad1:
                    path       = "English-Ukrainian.xml";
                    vocabulary = SerializeVocabularu.LoadVocab(path);
                    SecondMenu(path, vocabulary);
                    break;

                case ConsoleKey.NumPad2:
                    path       = "Ukrainian-English.xml";
                    vocabulary = SerializeVocabularu.LoadVocab(path);
                    SecondMenu(path, vocabulary);
                    break;

                default:
                    break;
                }
            }
        }
Exemple #2
0
        private static void SecondMenu(string path, MyVocabulary vocabulary)
        {
            View.SecondMenu();
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.SetCursorPosition(40, 1);
            Console.Write(vocabulary.name);

            while (true)
            {
                Console.SetCursorPosition(40, 20);
                switch (Console.ReadKey().Key)
                {
                case ConsoleKey.Escape:
                    SerializeVocabularu.WriteVocab(path, vocabulary);
                    View.OwnerMenu();
                    return;

                case ConsoleKey.D1:
                    menu(1);
                    break;

                case ConsoleKey.D2:
                    menu(2);
                    break;

                case ConsoleKey.D3:
                    menu(3);
                    break;

                case ConsoleKey.D4:
                    menu(4);
                    break;

                case ConsoleKey.D5:
                    menu(5);
                    break;

                case ConsoleKey.D6:
                    menu(6);
                    break;

                case ConsoleKey.D7:
                    menu(7);
                    break;

                case ConsoleKey.D8:
                    break;

                case ConsoleKey.D9:
                    break;

                case ConsoleKey.NumPad1:
                    menu(1);
                    break;

                case ConsoleKey.NumPad2:
                    menu(2);
                    break;

                case ConsoleKey.NumPad3:
                    menu(3);
                    break;

                case ConsoleKey.NumPad4:
                    menu(4);
                    break;

                case ConsoleKey.NumPad5:
                    menu(5);
                    break;

                case ConsoleKey.NumPad6:
                    menu(6);
                    break;

                case ConsoleKey.NumPad7:
                    menu(7);
                    break;

                case ConsoleKey.NumPad8:
                    break;

                case ConsoleKey.NumPad9:
                    break;

                default:
                    break;
                }
            }
        }