Beispiel #1
0
        static void Main(string[] args)
        {
            #region Lab_1
            var customerObserver = new CustomerObserver();

            ProductManager productManager = new ProductManager();
            productManager.Attached(new EmployeeObserver());
            productManager.Attached(customerObserver);
            productManager.UpdatePrice();
            #endregion


            #region Lab_2
            ConcreteProduct concreteProduct = new ConcreteProduct("Boxing Gloves", 12.55M);

            concreteProduct.FollowList.Add(new ConcreteMember {
                Email = "*****@*****.**"
            });
            concreteProduct.FollowList.Add(new ConcreteMember {
                Email = "*****@*****.**"
            });
            concreteProduct.FollowList.Add(new ConcreteMember {
                Email = "*****@*****.**"
            });

            concreteProduct.Price = 8.99M;

            #endregion

            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var            customer = new CustomerObserver();
            ProductManager pm       = new ProductManager();

            pm.Attach(customer);
            pm.Attach(new EmployeeObserver());
            pm.Detach(customer);
            pm.UpdatePrice();

            Console.ReadLine();
        }