コード例 #1
0
 /// <summary>
 /// Returns the members of the specified list.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="ownerUsername">The owner username.</param>
 /// <param name="listId">The list id.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult GetMembers(
     OAuthTokens tokens,
     string ownerUsername,
     string listId,
     GetListMembersOptions options,
     TimeSpan timeout,
     Action <TwitterAsyncResponse <TwitterUserCollection> > function)
 {
     return(AsyncUtility.ExecuteAsyncMethod(tokens, ownerUsername, listId, options, timeout, TwitterList.GetMembers, function));
 }
コード例 #2
0
 /// <summary>
 /// Returns the members of the specified list.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="username">The username.</param>
 /// <param name="listIdOrSlug">The list id or slug.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A collection of users as <see cref="TwitterUserCollection"/>.
 /// </returns>
 public static async Task <TwitterResponse <TwitterUserCollection> > MembersAsync(OAuthTokens tokens, string username, string listIdOrSlug, GetListMembersOptions options = null)
 {
     return(await Core.CommandPerformer.PerformAction(new Twitterizer.Commands.GetListMembersCommand(tokens, username, listIdOrSlug, options)));
 }
コード例 #3
0
ファイル: TwitterList.cs プロジェクト: Ruhowl/Twitterizer
        /// <summary>
        /// Returns the members of the specified list.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="username">The username.</param>
        /// <param name="listIdOrSlug">The list id or slug.</param>
        /// <param name="options">The options.</param>
        /// <returns>
        /// A collection of users as <see cref="TwitterUserCollection"/>.
        /// </returns>
        public static TwitterResponse<TwitterUserCollection> GetMembers(OAuthTokens tokens, string username, string listIdOrSlug, GetListMembersOptions options)
        {
            Commands.GetListMembersCommand command = new Twitterizer.Commands.GetListMembersCommand(tokens, username, listIdOrSlug, options);

            return CommandPerformer.PerformAction(command);
        }
コード例 #4
0
        /// <summary>
        /// Returns the members of the specified list.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="ownerUsername">The owner username.</param>
        /// <param name="listId">The list id.</param>
        /// <param name="options">The options.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        public static IAsyncResult GetMembers(
            OAuthTokens tokens, 
            string ownerUsername, 
            string listId,
            GetListMembersOptions options, 
            TimeSpan timeout, 
            Action<TwitterAsyncResponse<TwitterUserCollection>> function)
        {
            Func<OAuthTokens, string, string, GetListMembersOptions, TwitterResponse<TwitterUserCollection>> methodToCall = TwitterList.GetMembers;

            return methodToCall.BeginInvoke(
                tokens,
                ownerUsername,
                listId,
                options,
                result =>
                {
                    result.AsyncWaitHandle.WaitOne(timeout);
                    try
                    {
                        function(methodToCall.EndInvoke(result).ToAsyncResponse());
                    }
                    catch (Exception ex)
                    {
                        function(new TwitterAsyncResponse<TwitterUserCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
                    }
                },
                null);
        }
コード例 #5
0
ファイル: Lists.cs プロジェクト: DigitallyBorn/Twitterizer3
 /// <summary>
 /// Returns the members of the specified list.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="username">The username.</param>
 /// <param name="listIdOrSlug">The list id or slug.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A collection of users as <see cref="TwitterUserCollection"/>.
 /// </returns>
 public static async Task<TwitterResponse<TwitterUserCollection>> MembersAsync(OAuthTokens tokens, string username, string listIdOrSlug, GetListMembersOptions options = null)
 {
     return await Core.CommandPerformer.PerformAction(new Twitterizer.Commands.GetListMembersCommand(tokens, username, listIdOrSlug, options));
 }
コード例 #6
0
 /// <summary>
 /// Returns the members of the specified list.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="ownerUsername">The owner username.</param>
 /// <param name="listId">The list id.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult GetMembers(
     OAuthTokens tokens, 
     string ownerUsername, 
     string listId,
     GetListMembersOptions options, 
     TimeSpan timeout, 
     Action<TwitterAsyncResponse<TwitterUserCollection>> function)
 {
     return AsyncUtility.ExecuteAsyncMethod(tokens, ownerUsername, listId, options, timeout, TwitterList.GetMembers, function);
 }
コード例 #7
0
        /// <summary>
        /// Returns the members of the specified list.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="username">The username.</param>
        /// <param name="listIdOrSlug">The list id or slug.</param>
        /// <param name="options">The options.</param>
        /// <returns>
        /// A collection of users as <see cref="TwitterUserCollection"/>.
        /// </returns>
        public static TwitterResponse <TwitterUserCollection> GetMembers(OAuthTokens tokens, string username, string listIdOrSlug, GetListMembersOptions options)
        {
            Commands.GetListMembersCommand command = new Twitterizer.Commands.GetListMembersCommand(tokens, username, listIdOrSlug, options);

            return(CommandPerformer.PerformAction(command));
        }