/// <summary>
 /// Initializes a new instance based on the specified <code>client</code> and <code>query</code>.
 /// </summary>
 /// <param name="client">The parent OAuth client.</param>
 /// <param name="query">The query string as specified by the response body.</param>
 protected SocialOAuthRequestToken(SocialOAuthClient client, NameValueCollection query) {
     Client = client;
     Token = query["oauth_token"];
     TokenSecret = query["oauth_token_secret"];
     IsCallbackConfirmed = query["oauth_callback_confirmed"] == "true";
     AuthorizeUrl = client.AuthorizeUrl + "?oauth_token=" + query["oauth_token"];
 }
        /// <summary>
        /// Parses a query string received from the API.
        /// </summary>
        /// <param name="client">The parent OAuth client.</param>
        /// <param name="str">The query string.</param>
        public static SocialOAuthAccessToken Parse(SocialOAuthClient client, string str) {

            // Convert the query string to a NameValueCollection
            NameValueCollection query = SocialUtils.Misc.ParseQueryString(str);

            // Initialize a new instance
            return new SocialOAuthAccessToken(client, query);

        }
        /// <summary>
        /// Initializes a new instance based on the specified <code>client</code> and <code>query</code>.
        /// </summary>
        /// <param name="client">The parent OAuth client.</param>
        /// <param name="query">The query string as specified by the response body.</param>
        protected SocialOAuthAccessToken(SocialOAuthClient client, NameValueCollection query) {

            Client = client;

            // Get the user ID
            long userId;
            Int64.TryParse(query["user_id"], out userId);

            // Populate the properties
            Token = query["oauth_token"];
            TokenSecret = query["oauth_token_secret"];
            Query = query;

        }
示例#4
0
        /// <summary>
        /// Initializes a new instance based on the specified <paramref name="client"/> and <paramref name="query"/>.
        /// </summary>
        /// <param name="client">The parent OAuth client.</param>
        /// <param name="query">The query string as specified by the response body.</param>
        protected SocialOAuthAccessToken(SocialOAuthClient client, NameValueCollection query)
        {
            Client = client;

            // Get the user ID
            long userId;

            Int64.TryParse(query["user_id"], out userId);

            // Populate the properties
            Token       = query["oauth_token"];
            TokenSecret = query["oauth_token_secret"];
            Query       = query;
        }
 /// <summary>
 /// Parses a query string received from the API.
 /// </summary>
 /// <param name="client">The parent OAuth client.</param>
 /// <param name="query">The query string.</param>
 public static SocialOAuthAccessToken Parse(SocialOAuthClient client, NameValueCollection query) {
     return query == null ? null : new SocialOAuthAccessToken(client, query);
 }
 /// <summary>
 /// Parses a query string received from the API.
 /// </summary>
 /// <param name="client">The parent OAuth client.</param>
 /// <param name="query">The query string.</param>
 public new static TwitterOAuthAccessToken Parse(SocialOAuthClient client, NameValueCollection query)
 {
     return(query == null ? null : new TwitterOAuthAccessToken(client, query));
 }
 protected TwitterOAuthAccessToken(SocialOAuthClient client, NameValueCollection query) : base(client, query)
 {
     UserId     = Int64.Parse(query["user_id"]);
     ScreenName = query["screen_name"];
 }
 protected TwitterOAuthRequestToken(SocialOAuthClient client, NameValueCollection query) : base(client, query)
 {
 }
示例#9
0
 /// <summary>
 /// Parses a query string received from the API.
 /// </summary>
 /// <param name="client">The parent OAuth client.</param>
 /// <param name="query">The query string.</param>
 public static TwitterOAuthAccessToken Parse(SocialOAuthClient client, IHttpQueryString query)
 {
     return(query == null ? null : new TwitterOAuthAccessToken(client, query));
 }
示例#10
0
 protected TwitterOAuthAccessToken(SocialOAuthClient client, IHttpQueryString query) : base(client, query)
 {
     UserId     = Int64.Parse(query["user_id"]);
     ScreenName = query["screen_name"];
 }
 protected TwitterOAuthRequestToken(SocialOAuthClient client, IHttpQueryString query) : base(client, query)
 {
 }
 /// <summary>
 /// Parses a query string received from the API.
 /// </summary>
 /// <param name="client">The parent OAuth client.</param>
 /// <param name="query">The query string.</param>
 public static SocialOAuthRequestToken Parse(SocialOAuthClient client, NameValueCollection query)
 {
     return(query == null ? null : new SocialOAuthRequestToken(client, query));
 }