/// <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)); }
/// <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))); }
/// <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); }
/// <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); }
/// <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)); }
/// <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); }
/// <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)); }