public NotificationObserver(NotificationGrabber _notificationGrabber) { this.notificationGrabber = _notificationGrabber; this.observerID = ++observerIDCount; this.notificationGrabber.register(this); Console.WriteLine("New observer: " + observerID); }
public static void RunTest() { NotificationGrabber grabber = new NotificationGrabber(); NotificationGrabber grabber2 = new NotificationGrabber(); NotificationObserver observerOne = new NotificationObserver(grabber); NotificationObserver observerTwo = new NotificationObserver(grabber2); grabber.setCallNotifcation("Mom called!"); grabber2.setTextNotifcation("Hey, how are you?"); }