public static CreatorProducts getInstance() { if (instance == null) { instance = new CreatorProducts(); } return(instance); }
public void AddProduct(String name, int count) { int pos = FindPositionProductInBasket(name); if (pos == -1) { basket.Add(CreatorProducts.getInstance().CreateProduct(name)); basket[basket.Count - 1].AddCountInOrder(count); } else { basket[pos].AddCountInOrder(count); } }