Beispiel #1
0
        public void RegisterColleague(IColleague colleague)
        {
            if (Colleagues.Contains(colleague))
            {
                return;
            }

            colleague.SetMediator(this);

            Colleagues.Add(colleague);
        }
Beispiel #2
0
 /// <summary>
 /// 中介者可以动态地与某个同事建立联系
 /// </summary>
 /// <param name="name"></param>
 /// <param name="colleague"></param>
 public void AddColleague(String name, IColleague colleague)
 {
     //在中介者这里帮助具体同事建立起于中介者的联系
     colleague.SetMediator(this);
     this.Colleagues.Add(name, colleague);
 }
Beispiel #3
0
 /// <summary>
 /// 中介者可以动态地与某个同事建立联系  
 /// </summary>
 /// <param name="name"></param>
 /// <param name="colleague"></param>
 public void AddColleague(String name, IColleague colleague)
 {
     //在中介者这里帮助具体同事建立起于中介者的联系
     colleague.SetMediator(this);
     this.Colleagues.Add(name, colleague);
 }