public static IOffer CreateOffer(OfferType type)
        {
            IOffer offer = null;

            switch (type)
            {
            case OfferType.Rent: offer = new RentOffer(); break;

            case OfferType.Sale: offer = new SaleOffer(); break;
            }

            return(offer);
        }
Exemplo n.º 2
0
        public static IOffer CreateOffer(OfferType type)
        {
            IOffer offer = null;

            switch (type)
            {
                case OfferType.Rent:
                    offer = new RentOffer(OfferType.Rent);
                    break;
                case OfferType.Sale:
                    offer = new SaleOffer(OfferType.Sale);
                    break;
                default:
                    throw new ArgumentException("Unsuported office type");
            }

            return offer;
        }