예제 #1
0
        public void Update(object ob)
        {
            BindInformation sInfo = (BindInformation)ob;

            if (sInfo.LotPrice < 200)
            {
                Console.WriteLine($"Сотрудник {this.Name} забирает лот по цене: {sInfo.LotPrice}$");
            }
            else
            {
                Console.WriteLine($"Сотрудник {this.Name} отказывается от лота с ценой: {sInfo.LotPrice}$");
            }
        }
예제 #2
0
        public void Update(object ob)
        {
            BindInformation sInfo = (BindInformation)ob;

            if (sInfo.LotPrice > 200)
            {
                Console.WriteLine($"Гость {this.Name} заберает лот по цене: {sInfo.LotPrice}$");
            }
            else
            {
                Console.WriteLine($"Гость {this.Name} не интересуется лотом по цене: {sInfo.LotPrice}$");
            }
        }
예제 #3
0
 List <IObserver> observers;             // коллекция наблюдателей
 public Bargaining()                     // ctor
 {
     observers = new List <IObserver>(); // инициализация объектов
     sInfo     = new BindInformation();
 }