private void button1_Click(object sender, EventArgs e)
 {
     var book = Library.booksList.Find(x => x.Title == listBox1.Text);
     client.rentedBooks.Add(book);
     RentedBookPublisher rentedBook = new RentedBookPublisher();
     RentedBookSubscriber mySubscriber = new RentedBookSubscriber(rentedBook);
     rentedBook.RaiseEvent();
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var book = Library.booksList.Find(x => x.Title == listBox1.Text);

            client.rentedBooks.Add(book);
            RentedBookPublisher  rentedBook   = new RentedBookPublisher();
            RentedBookSubscriber mySubscriber = new RentedBookSubscriber(rentedBook);

            rentedBook.RaiseEvent();
        }
Example #3
0
 public RentedBookSubscriber(RentedBookPublisher myPublisher)
 {
     myPublisher.RaiseCustomEvent += HandleEvent;
 }
 public RentedBookSubscriber(RentedBookPublisher myPublisher)
 {
     myPublisher.RaiseCustomEvent += HandleEvent;
 }