Exemplo n.º 1
0
        private void addUser()
        {
            bool restart = STREAM.StreamState == StreamState.Running;

            if (restart)
            {
                STREAM.StopStream();
            }

            if (STREAM.ContainsFollow(UserId))
            {
                STREAM.FollowingUserIds[UserId] += x => TweetReceived(x);
            }
            else
            {
                STREAM.AddFollow(UserId, x => TweetReceived(x));
            }

            if (restart && STREAM.FollowingUserIds.Count == 1)
            {
                STREAM.StartStreamMatchingAllConditionsAsync();
            }
        }