static void Main(string[] args)
        {
            ApplicationMediator mediator = new ApplicationMediator();

            ConcreteColleague desktop = new ConcreteColleague(mediator);
            MobileColleague   mobile  = new MobileColleague(mediator);

            mediator.addColleague(desktop);
            mediator.addColleague(mobile);

            desktop.send("Hello World");
            mobile.send("Hello");

            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            ApplicationMediator mediator = new ApplicationMediator();

            ConcreteColleague desktop = new ConcreteColleague(mediator);
            MobileColleague mobile = new MobileColleague(mediator);

            mediator.addColleague(desktop);
            mediator.addColleague(mobile);

            desktop.send("Hello World");
            mobile.send("Hello");

            Console.ReadKey();
        }