예제 #1
0
        public static void Main()
        {
            Clock theClock = new Clock();

            DisplayClock dc = new DisplayClock();

            dc.Subscribe(theClock);

            LogCurrentTime lct = new LogCurrentTime();

            lct.Subscribe(theClock);

            theClock.Run();
        }
예제 #2
0
        static void Main()
        {
            //pravi novi sata
            Clock theClock = new Clock();

            //pravi prikaz i govori mu da se pretplati na upravo otvoren sat
            DisplayClock dc = new DisplayClock();

            dc.Subscribe(theClock);

            //pravi log objekat i govori mu da se pretplati na sat
            LogCurrentTime lct = new LogCurrentTime();

            lct.Subscribe(theClock);

            //pokrece sat
            theClock.Run();
        }
        public static void Main()
        {
            // create a new clock
            Clock theClock = new Clock();

            // create the display and tell it to
            // subscribe to the clock just created
            DisplayClock dc = new DisplayClock();

            dc.Subscribe(theClock);

            // create a Log object and tell it
            // to subscribe to the clock
            LogCurrentTime lct = new LogCurrentTime();

            lct.Subscribe(theClock);

            // Get the clock started
            theClock.Run();
        }