Beispiel #1
0
        public static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            //var mediator = new ConcreteMediator();

            //var c1 = new Colleague1();
            //var c2 = new Colleague2();

            //mediator.Register(c1);
            //mediator.Register(c2);

            //c1.Send("siema");
            //c2.Send("Elo");

            //Console.ReadLine();

            var teamChat = new TeamChatroom();

            var steve   = new Developer("Steve");
            var dariusz = new Developer("Darius");
            var adam    = new Tester("Adam");

            teamChat.RegisterMembers(steve, dariusz, adam);

            dariusz.Send("siema wszyscy");
            adam.Send("eldo all");

            steve.SendTo <Developer>("siema developerzy");

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            var teamChat = new TeamChatroom();

            var steve  = new Developer("Steve");
            var justin = new Developer("Justin");
            var jenna  = new Developer("Jenna");
            var kim    = new Tester("Kim");
            var julia  = new Tester("Julia");

            teamChat.RegisterMembers(steve, justin, jenna, kim, julia);

            steve.Send("Hey everyone we're going to be deploying at 2pm today.");
            kim.Send("OK, thanks for letting us know.");

            Console.WriteLine();
            steve.SendTo <Developer>("Make sure to execute your unit tests before checking in.");
        }