Пример #1
0
        private static void Main(string[] args)
        {
            var reservation = new Reservation.Reservation()
            {
                Name     = "John",
                LastName = "Galt",
                Book     = new Book.Book()
                {
                    Name = "BookName",
                    ISBN = "978-3-16-148410-0"
                }
            };

            var reservationObserver = new ReservationObserver(reservation);

            foreach (var librarian in GetLibrarians())
            {
                reservationObserver.RegisterObserver(new ReservationSubscriber(librarian));
            }

            reservationObserver.Publish();
            reservationObserver.NotifyObservers();
        }