示例#1
0
        public void TestMethod1()
        {
            var mediator = new ConcreteMediator();
            var colleague1 = new ConcreteColleague(mediator);
            var colleague2 = new ConcreteColleague(mediator);

            mediator.AddColleague(colleague1);
            mediator.AddColleague(colleague2);

            colleague1.Send("form C1");
            colleague2.Send("from C2");
        }
示例#2
0
 public void AddColleague(ConcreteColleague colleague)
 {
     _colleagues.Add(colleague);
 }
示例#3
0
 public void AddColleague(ConcreteColleague colleague)
 {
     _colleagues.Add(colleague);
 }