public void NotifySubscribers(ObserverContextType type) { foreach (var subscriber in subsribers) { subscriber.Notify(type); } }
public void Notify(ObserverContextType type) { if (type != ObserverContextType.IncomeProduct) { return; } Console.WriteLine("Shop: income new products."); }
public void Notify(ObserverContextType type) { if (type != ObserverContextType.SellProduct) { return; } Console.WriteLine("Shop: was made a sell."); }