Exemplo n.º 1
0
 /// <summary>
 /// List the lists the specified user has been added to.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="username">The username.</param>
 /// <param name="options">The options.</param>
 /// <returns>
 /// A <see cref="TwitterListCollection"/> instance.
 /// </returns>
 public static TwitterResponse<TwitterListCollection> GetMemberships(OAuthTokens tokens, string username, ListMembershipsOptions options)
 {
     Commands.ListMembershipsCommand command = new Twitterizer.Commands.ListMembershipsCommand(tokens, username, options);
     return Core.CommandPerformer.PerformAction(command);
 }
Exemplo n.º 2
0
 /// <summary>
 /// List the lists the specified user has been added to.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="username">The userid.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A <see cref="TwitterListCollection"/> instance.
 /// </returns>
 public static async Task <TwitterResponse <TwitterListCollection> > MembershipsAsync(decimal userid, OAuthTokens tokens, ListMembershipsOptions options = null)
 {
     return(await Core.CommandPerformer.PerformAction(new Twitterizer.Commands.ListMembershipsCommand(tokens, userid, options)));
 }
Exemplo n.º 3
0
        /// <summary>
        /// List the lists the specified user has been added to.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="username">The username.</param>
        /// <param name="options">The options.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        public static IAsyncResult GetMemberships(OAuthTokens tokens, string username, ListMembershipsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterListCollection>> function)
        {
            Func<OAuthTokens, string, ListMembershipsOptions, TwitterResponse<TwitterListCollection>> methodToCall = TwitterList.GetMemberships;

            return methodToCall.BeginInvoke(
                tokens,
                username,
                options,
                result =>
                {
                    result.AsyncWaitHandle.WaitOne(timeout);
                    try
                    {
                        function(methodToCall.EndInvoke(result).ToAsyncResponse());
                    }
                    catch (Exception ex)
                    {
                        function(new TwitterAsyncResponse<TwitterListCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
                    }
                },
                null);
        }
Exemplo n.º 4
0
 /// <summary>
 /// List the lists the specified user has been added to.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="username">The userid.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A <see cref="TwitterListCollection"/> instance.
 /// </returns>
 public static async Task<TwitterResponse<TwitterListCollection>> MembershipsAsync(decimal userid, OAuthTokens tokens, ListMembershipsOptions options = null)
 {
     return await Core.CommandPerformer.PerformAction(new Twitterizer.Commands.ListMembershipsCommand(tokens, userid, options));
 }
Exemplo n.º 5
0
 /// <summary>
 /// List the lists the specified user has been added to.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="userid">The userid.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult GetMemberships(OAuthTokens tokens, decimal userid, ListMembershipsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterListCollection>> function)
 {
     return AsyncUtility.ExecuteAsyncMethod(tokens, userid, options, timeout, TwitterList.GetMemberships, function);
 }
Exemplo n.º 6
0
 /// <summary>
 /// List the lists the specified user has been added to.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="username">The userid.</param>
 /// <param name="options">The options.</param>
 /// <returns>
 /// A <see cref="TwitterListCollection"/> instance.
 /// </returns>
 public static TwitterResponse <TwitterListCollection> GetMemberships(OAuthTokens tokens, decimal userid, ListMembershipsOptions options)
 {
     Commands.ListMembershipsCommand command = new Twitterizer.Commands.ListMembershipsCommand(tokens, userid, options);
     return(Core.CommandPerformer.PerformAction(command));
 }
Exemplo n.º 7
0
 /// <summary>
 /// List the lists the specified user has been added to.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="userid">The userid.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult GetMemberships(OAuthTokens tokens, decimal userid, ListMembershipsOptions options, TimeSpan timeout, Action <TwitterAsyncResponse <TwitterListCollection> > function)
 {
     return(AsyncUtility.ExecuteAsyncMethod(tokens, userid, options, timeout, TwitterList.GetMemberships, function));
 }