Exemplo n.º 1
0
        static void Main(string[] args)
        {
            BaggageHandler  provider  = new BaggageHandler();
            ArrivalsMonitor observer1 = new ArrivalsMonitor("BaggageClaimMonitor1");
            ArrivalsMonitor observer2 = new ArrivalsMonitor("SecurityExit");

            BaggageHandler  provider2 = new BaggageHandler();
            ArrivalsMonitor observer3 = new ArrivalsMonitor("안녕하세요");

            provider.BaggageStatus(712, "Detroit", 3);
            observer1.Subscribe(provider);
            observer2.Subscribe(provider);

            provider2.BaggageStatus(700, "파스타", 2);
            observer3.Subscribe(provider2);

            provider.BaggageStatus(711, "Detroit2", 2);

            /*
             * provider.BaggageStatus(712, "Kalamazoo", 3);
             * provider.BaggageStatus(400, "New York-Kennedy", 1);
             * provider.BaggageStatus(712, "Detroit", 3);
             * observer2.Subscribe(provider);
             * provider.BaggageStatus(511, "San Francisco", 2);
             * provider.BaggageStatus(712);
             */
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            BaggageHandler  provider  = new BaggageHandler();
            ArrivalsMonitor observer1 = new ArrivalsMonitor("11111111");
            ArrivalsMonitor observer2 = new ArrivalsMonitor("222222222");

            BaggageHandler  provider2 = new BaggageHandler();
            ArrivalsMonitor observer3 = new ArrivalsMonitor("33333333");

            provider.BaggageStatus(712, "Detroit", 3, "dsasddas");
            observer1.Subscribe(provider);
            observer2.Subscribe(provider);

            provider2.BaggageStatus(700, "파스타", 2, "aaaaaaaaaaaaaaa");
            observer3.Subscribe(provider2);

            provider.BaggageStatus(711, "Detroit2", 2, "bbbbbbbbbbbbbb");
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            BaggageHandler  provider  = new BaggageHandler();
            ArrivalsMonitor observer1 = new ArrivalsMonitor("BaggageClaimMonitor1");
            ArrivalsMonitor observer2 = new ArrivalsMonitor("SecurityExit");

            provider.BaggageStatus(712, "Detroit", 3);
            observer1.Subscribe(provider);
            provider.BaggageStatus(712, "Kalamazoo", 3);
            provider.BaggageStatus(400, "New York-Kennedy", 1);
            provider.BaggageStatus(712, "Detroit", 3);
            observer2.Subscribe(provider);
            provider.BaggageStatus(511, "San Francisco", 2);
            provider.BaggageStatus(712);
            observer2.UnSubscribe();
            provider.BaggageStatus(400);
            provider.LastBaggageClaimed();
        }