Пример #1
0
        /// <summary>
        /// Get users with full params
        /// </summary>
        private static IEnumerable <long> GetUserIds(this CredentialProvider provider, string partialUri, long?userId, string screenName, long?cursor, out long prevCursor, out long nextCursor)
        {
            List <KeyValuePair <string, string> > para = new List <KeyValuePair <string, string> >();

            if (userId != null)
            {
                para.Add(new KeyValuePair <string, string>("user_id", userId.ToString()));
            }
            if (screenName != null)
            {
                para.Add(new KeyValuePair <string, string>("screen_name", screenName));
            }
            if (cursor != null)
            {
                para.Add(new KeyValuePair <string, string>("cursor", cursor.ToString()));
            }
            return(provider.GetUserIds(partialUri, para, out prevCursor, out nextCursor));
        }
Пример #2
0
        /// <summary>
        /// Get users with use cursor params
        /// </summary>
        private static IEnumerable <long> GetUserIdsAll(this CredentialProvider provider, string partialUri, long?userId, string screenName)
        {
            long n_cursor = -1;
            long c_cursor = -1;
            long p;

            while (n_cursor != 0)
            {
                var users = provider.GetUserIds(partialUri, userId, screenName, c_cursor, out p, out n_cursor);
                if (users != null)
                {
                    foreach (var u in users)
                    {
                        yield return(u);
                    }
                }
                c_cursor = n_cursor;
            }
        }