コード例 #1
0
ファイル: Program.cs プロジェクト: tpiotrowski/DesignPatterns
        private static void Main()
        {
            var mediator = new ConcreteMediator();

            var concreteColleagueA = new ConcreteColleagueA(mediator);
            var concreteColleagueB = new ConcreteColleagueB(mediator);

            mediator.ColleagueA = concreteColleagueA;
            mediator.ColleagueB = concreteColleagueB;

            concreteColleagueA.Send("How are you?");
            concreteColleagueA.Send("Fine, thanks");

            Console.ReadKey();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: suprcodr/DesignPatterns
        private static void Main()
        {
            var mediator = new ConcreteMediator();

            var concreteColleagueA = new ConcreteColleagueA(mediator);

            var concreteColleagueB = new ConcreteColleagueB(mediator);

            mediator.ColleagueA = concreteColleagueA;

            mediator.ColleagueB = concreteColleagueB;

            concreteColleagueA.Send("Message from ConcreteColleagueA");

            concreteColleagueB.Send("Message from ConcreteColleagueB");

            Console.ReadKey();
        }