Ejemplo n.º 1
0
        public IPrototype Clone()
        {
            PriceListImpl clone = new PriceListImpl(listName);

            clone.setProducts(products);
            return(clone);
        }
Ejemplo n.º 2
0
        public IPrototype DeepClone()
        {
            List <ProductItem> cloneProducts = new List <ProductItem>();

            foreach (ProductItem item in this.products)
            {
                ProductItem cloneItem = (ProductItem)item.Clone();
                cloneProducts.Add(cloneItem);
            }
            PriceListImpl clone = new PriceListImpl(listName);

            clone.setProducts(cloneProducts);
            return(clone);
        }