Пример #1
0
        public static void SwitchForTask2(int value)
        {
            switch (value)
            {
            case 1:
                Task2.Figure rectangle = new Task2.Rectangle(5, 7);
                Task2.Figure square    = new Task2.Square(2);
                Console.WriteLine(rectangle.Draw());
                Console.WriteLine(square.Draw());
                break;

            case 2:
                Task2.VirtualDraw.Figure    figure     = new Task2.VirtualDraw.Figure(2, 3);
                Task2.VirtualDraw.Rectangle rectangle1 = new Task2.VirtualDraw.Rectangle(4, 5);
                Task2.VirtualDraw.Square    square1    = new Task2.VirtualDraw.Square(7, 8);

                Console.WriteLine(figure.Draw());
                Console.WriteLine(rectangle1.Draw());
                Console.WriteLine(square1.Draw());
                break;

            case 3:
                Task2.FigureWithInterface.IDrawable[] arr = new Task2.FigureWithInterface.IDrawable[3];

                arr[0] = new Task2.FigureWithInterface.Figure(1, 2);
                arr[1] = new Task2.FigureWithInterface.Rectangle(3, 4);
                arr[2] = new Task2.FigureWithInterface.Square(5, 6);
                DrawAll(arr);
                break;
            }
        }
Пример #2
0
        public void Setup()
        {
            rec = new Task1.Rectangle(1, 2, 5, 0);

            circle  = new Circle();
            number1 = new ComplexNumber(2, 3);
            number2 = new ComplexNumber(-1, 1);
            T2rec   = new Task2.Rectangle(1, 2);
            square  = new Square(2);
            figure  = new Task2.FigureWithInterface.Figure(1, 3);
            rect3   = new Task2.FigureWithInterface.Rectangle(3, 4);
            square2 = new Task2.FigureWithInterface.Square(5, 5);

            rect4   = new Task2.VirtualDraw.Rectangle(1, 2);
            figure2 = new Task2.VirtualDraw.Figure(3, 4);
            square3 = new Task2.VirtualDraw.Square(3, 3);
        }