Esempio n. 1
0
 public void AddListener(SubscribeCallback listener)
 {
     if (listener != null)
     {
         lock (syncLockSubscribeCallback)
         {
             SubscribeCallbackListenerList.Add(listener);
         }
     }
 }
Esempio n. 2
0
 public void AddListener(SubscribeCallback listener)
 {
     if (listener != null)
     {
         lock (syncLockSubscribeCallback)
         {
             if (SubscribeCallbackListenerList.ContainsKey(PubnubInstance.InstanceId))
             {
                 List <SubscribeCallback> callbackList = SubscribeCallbackListenerList[PubnubInstance.InstanceId];
                 callbackList.Add(listener);
                 SubscribeCallbackListenerList[PubnubInstance.InstanceId] = callbackList;
             }
             else
             {
                 List <SubscribeCallback> callbackList = new List <SubscribeCallback>();
                 callbackList.Add(listener);
                 SubscribeCallbackListenerList.Add(PubnubInstance.InstanceId, callbackList);
             }
         }
     }
 }