Ejemplo n.º 1
0
 private async void UsersChanged(IEnumerable <long> userIds)
 {
     if (!_members.SyncSet(userIds))
     {
         return;
     }
     if (_receiver.ListId != null)
     {
         await ListProxy.SetListMembers(_receiver.ListId.Value, _members);
     }
     ListMemberChanged?.Invoke(this, Tuple.Create(_listParam, _members.AsEnumerable()));
 }
Ejemplo n.º 2
0
 public static void Initialize()
 {
     BehaviorLogger.Log("RM", "initializing...");
     _userReceiveManager       = new UserReceiveManager();
     _searchReceiveManager     = new SearchReceiveManager();
     _listReceiveManager       = new ListReceiveManager();
     _listMemberReceiveManager = new ListMemberReceiveManager();
     _listMemberReceiveManager.ListMemberChanged += li => ListMemberChanged?.Invoke(li);
     _streamTrackReceiveManager = new StreamTrackReceiveManager(_userReceiveManager);
     _userReceiveManager.ConnectionStateChanged += arg => UserStreamsConnectionStateChanged?.Invoke(arg.Id);
     BehaviorLogger.Log("RM", "init.");
     ReceiveEngine.Begin();
 }
Ejemplo n.º 3
0
 public void StartReceive(TwitterAccount account, ListInfo info)
 {
     lock (_listReceiverLocker)
     {
         if (_listReceiverReferenceCount.ContainsKey(info))
         {
             _listReceiverReferenceCount[info]++;
         }
         else
         {
             _listReceiverReferenceCount.Add(info, 1);
             var listener = new ListMemberListener(account.CreateAccessor(), info);
             _receiverDictionary.Add(info, listener);
             listener.ListMemberChanged += (o, e) => ListMemberChanged?.Invoke(e);
         }
     }
 }