Esempio n. 1
0
        static void CreateShape()
        {
            Console.WriteLine("Create shape.");
            Console.Write("1. Line\n2. Triangle\n3. Rectangle\n4. Circle\n5. Return to menu\n-> ");
            var key = Console.ReadKey().KeyChar;

            Console.Clear();
            switch (key)
            {
            case '1':
                ShapeController.CreateLine();
                break;

            case '2':
                ShapeController.CreateTriangle();
                break;

            case '3':
                ShapeController.CreateRectangle();
                break;

            case '4':
                ShapeController.CreateCircle();
                break;

            case '5': return;

            default: throw new MenuArgumentException();
            }
            Console.Clear();
        }