Example #1
0
        public NotificationObserver(NotificationGrabber _notificationGrabber)
        {
            this.notificationGrabber = _notificationGrabber;

            this.observerID = ++observerIDCount;

            this.notificationGrabber.register(this);

            Console.WriteLine("New observer: " + observerID);
        }
Example #2
0
        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?");
        }