Exemple #1
0
        static void Main(string[] args)
        {
            ShapeFactory shapeFactory = new ShapeFactory();
            var          circleObj    = shapeFactory.GetData((int)Shape.Circle).DataItem as Circle;

            circleObj.GetInfo();
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            ShapeFactory shapeFactory = new ShapeFactory();
            ColorFactory colorFactory = new ColorFactory();

            Circle circle = shapeFactory.GetData((int)ShapeType.Circle).DataItem as Circle;

            circle.GetInfo();

            Red red = colorFactory.GetData((int)ColorType.Red).DataItem as Red;

            red.GetInfo();

            Console.WriteLine("The Ray Code is AWESOME!!");
        }