Example #1
0
        public override FactoryDataItem Getdata(int type)
        {
            FactoryDataItem factoryDataItem = null;

            switch ((ShapeType)type)
            {
            case ShapeType.Circle:
                factoryDataItem = new FactoryDataItem(new Circle());
                break;

            case ShapeType.Rectangle:
                factoryDataItem = new FactoryDataItem(new Rectangle());
                break;

            case ShapeType.Square:
                factoryDataItem = new FactoryDataItem(new Square());
                break;
            }
            return(factoryDataItem);
        }
Example #2
0
        public override FactoryDataItem Getdata(int type)
        {
            FactoryDataItem factoryDataItem = null;

            switch ((ColorType)type)
            {
            case ColorType.red:
                factoryDataItem = new FactoryDataItem(new Red());
                break;

            case ColorType.blue:
                factoryDataItem = new FactoryDataItem(new Blue());
                break;

            case ColorType.green:
                factoryDataItem = new FactoryDataItem(new Greeb());
                break;
            }
            return(factoryDataItem);
        }