private static void StructuralExample()
        {
            var mediator = new ConcreteMediator();
            var c1       = mediator.CreateColleague <ConcreteColleague>();
            var c2       = mediator.CreateColleague <SecondConreteColleage>();

            c1.Send("hello from colleague 1");
            c2.Send("hello from colleague 2");
        }
Beispiel #2
0
        public void Structural()
        {
            var mediator = new ConcreteMediator();
            var c1       = mediator.CreateColleague <Colleague1>();
            var c2       = mediator.CreateColleague <Colleague2>();

            c1.Send("Hello, World! (from c1)");
            c2.Send("Hello, World! (from c2)");
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var mediator = new ConcreteMediator();

            var c1 = mediator.CreateColleague <Colleague1>();
            var c2 = mediator.CreateColleague <Colleague2>();

            c1.Send("Hello (from c1)");
            c2.Send("Hello (from c2)");
        }
        private static void StructuralExample()
        {
            var mediator = new ConcreteMediator();
            //var c1 = new Colleague1();
            //var c2 = new Colleague2();
            ////mediator.Colleague1 = c1;
            ////mediator.Colleague2 = c2;
            //mediator.Register(c1);
            //mediator.Register(c2);
            var c1 = mediator.CreateColleague <Colleague1>();
            var c2 = mediator.CreateColleague <Colleague2>();

            c1.Send("Hello, World! (from c1)");
            c2.Send("hi, there! (from c2)");
        }
Beispiel #5
0
        private static void StructuralExample()
        {
            var mediator = new ConcreteMediator();

            /*var c1 = new Colleague1();
             * var c2 = new Colleague2();
             * mediator.Register(c1);
             * mediator.Register(c2);*/

            var c1 = mediator.CreateColleague <Colleague1>();
            var c2 = mediator.CreateColleague <Colleague2>();

            c1.Send("Hello, boys");
            c2.Send("Hello, girls");

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

            //var coll1 = new Colleague1();
            //var coll2 = new Colleague2();

            //mediator.Register(coll1);
            //mediator.Register(coll2);

            var coll1 = mediator.CreateColleague <Colleague1>();
            var coll2 = mediator.CreateColleague <Colleague2>();


            coll1.Send("Hello world this - colleage 1 message");
            coll2.Send("Hello world this - colleage 2 message");

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            var mediator = new ConcreteMediator();

            // original implementation
            // var c1 = new Colleague1(mediator);
            // var c2 = new Colleague2(mediator);
            //
            // mediator.Colleague1 = c1;
            // mediator.Colleague2 = c2;

            // second implementation
            // var c1 = new Colleague1();
            // var c2 = new Colleague2();
            //
            // mediator.Register(c1);
            // mediator.Register(c2);

            var c1 = mediator.CreateColleague <Colleague1>();
            var c2 = mediator.CreateColleague <Colleague2>();

            c1.Send("Hello, world! Sent by c1");
            c2.Send("Hello, world! Sent by c2");
        }