예제 #1
0
        static void Main(string[] args)
        {
            var descriptor = new ShapeDescriptor(new Point(1, 2), new Point(3, 4), new Point(4, 5));

            Console.WriteLine(descriptor.type);

            var descriptor2 = new ShapeDescriptor(new Point(1, 2), new Point(3, 4), new Point(4, 5), new Point(4, 5));

            Console.WriteLine(descriptor2.type);
            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            var p1 = new Point(10, 10);
            var p2 = new Point(10, 20);
            var p3 = new Point(20, 10);
            var p4 = new Point(20, 20);

            var shape1 = new ShapeDescriptor(p1);
            var shape2 = new ShapeDescriptor(p1, p2);
            var shape3 = new ShapeDescriptor(p1, p2, p3);
            var shape4 = new ShapeDescriptor(p1, p2, p3, p4);

            Console.WriteLine("Shape: {0}", shape1.ShapeType);
            Console.WriteLine("Shape: {0}", shape2.ShapeType);
            Console.WriteLine("Shape: {0}", shape3.ShapeType);
            Console.WriteLine("Shape: {0}", shape4.ShapeType);

            Console.ReadKey();
        }