Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            TextQuestion tq = new TextQuestion();

            label1.Text = tq.QType.ToString();

            IWorker james = new Work1();
            IWorker kobe  = new Work2();

            label2.Text = james.Work("James", "coding");
            label3.Text = kobe.Work("Kobe", "swim");
        }
Esempio n. 2
0
        public void start()
        {
            while (inMenu)
            {
                Console.WriteLine("Для выбора задания нажмите 1-5, для выхода - Escape");
                Console.Write("Ввод: ");
                keyInfo = Console.ReadKey(true);
                Console.Clear();

                switch (keyInfo.Key)
                {
                case ConsoleKey.Escape:
                    inMenu = false;
                    break;

                case ConsoleKey.D1:
                    Work1.foo();
                    break;

                case ConsoleKey.D2:
                    Work2.foo();
                    break;

                case ConsoleKey.D3:
                    Work3.foo();
                    break;

                case ConsoleKey.D4:
                    Work4.foo();
                    break;

                case ConsoleKey.D5:
                    Work5.foo();
                    break;
                }
            }
        }