Пример #1
0
 /// <summary> 添加订阅者 </summary>
 /// <param name="key"></param>
 /// <param name="publisher">订阅者</param>
 public void AddPublisher(string key, PublisherBase <T> publisher)
 {
     if (_publishers.ContainsKey(key))
     {
         return;
     }
     //添加更新方法
     publisher.Update += Response;
     _publishers.TryAdd(key, publisher);
 }
Пример #2
0
 /// <summary> 添加订阅者 </summary>
 /// <param name="publisher"></param>
 public void AddPublisher(PublisherBase <T> publisher)
 {
     AddPublisher(publisher.PublisherKey, publisher);
 }