Ejemplo n.º 1
0
 /// <summary>
 /// List the lists the specified user follows.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="userName">Name of the user.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult GetSubscriptions(
     OAuthTokens tokens,
     string userName,
     GetListSubscriptionsOptions options,
     TimeSpan timeout,
     Action <TwitterAsyncResponse <TwitterListCollection> > function)
 {
     return(AsyncUtility.ExecuteAsyncMethod(tokens, userName, options, timeout, TwitterList.GetSubscriptions, function));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// List the lists the specified user follows.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="userName">Name of the user.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A <see cref="TwitterListCollection"/> instance.
 /// </returns>
 public static async Task <TwitterResponse <TwitterListCollection> > SubscriptionsAsync(string userName, OAuthTokens tokens, GetListSubscriptionsOptions options = null)
 {
     return(await Core.CommandPerformer.PerformAction(new Twitterizer.Commands.GetListSubscriptionsCommand(tokens, userName, options)));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// List the lists the specified user follows.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="userName">Name of the user.</param>
        /// <param name="options">The options.</param>
        /// <returns>
        /// A <see cref="TwitterListCollection"/> instance.
        /// </returns>
        public static TwitterResponse<TwitterListCollection> GetSubscriptions(OAuthTokens tokens, string userName, GetListSubscriptionsOptions options)
        {
            Commands.GetListSubscriptionsCommand command = new Twitterizer.Commands.GetListSubscriptionsCommand(tokens, userName, options);

            return Core.CommandPerformer.PerformAction(command);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// List the lists the specified user follows.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="userName">Name of the user.</param>
        /// <param name="options">The options.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        public static IAsyncResult GetSubscriptions(
            OAuthTokens tokens, 
            string userName,
            GetListSubscriptionsOptions options, 
            TimeSpan timeout, 
            Action<TwitterAsyncResponse<TwitterListCollection>> function)
        {
            Func<OAuthTokens, string, GetListSubscriptionsOptions, TwitterResponse<TwitterListCollection>> methodToCall = TwitterList.GetSubscriptions;

            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);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// List the lists the specified user follows.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="userName">Name of the user.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A <see cref="TwitterListCollection"/> instance.
 /// </returns>
 public static async Task<TwitterResponse<TwitterListCollection>> SubscriptionsAsync(string userName, OAuthTokens tokens, GetListSubscriptionsOptions options = null)
 {
     return await Core.CommandPerformer.PerformAction(new Twitterizer.Commands.GetListSubscriptionsCommand(tokens, userName, options));
 }            
Ejemplo n.º 6
0
 /// <summary>
 /// List the lists the specified user follows.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="userName">Name of the user.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult GetSubscriptions(
     OAuthTokens tokens, 
     string userName,
     GetListSubscriptionsOptions options, 
     TimeSpan timeout, 
     Action<TwitterAsyncResponse<TwitterListCollection>> function)
 {
     return AsyncUtility.ExecuteAsyncMethod(tokens, userName, options, timeout, TwitterList.GetSubscriptions, function);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// List the lists the specified user follows.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="userName">Name of the user.</param>
        /// <param name="options">The options.</param>
        /// <returns>
        /// A <see cref="TwitterListCollection"/> instance.
        /// </returns>
        public static TwitterResponse <TwitterListCollection> GetSubscriptions(OAuthTokens tokens, string userName, GetListSubscriptionsOptions options)
        {
            Commands.GetListSubscriptionsCommand command = new Twitterizer.Commands.GetListSubscriptionsCommand(tokens, userName, options);

            return(Core.CommandPerformer.PerformAction(command));
        }