public async Task <bool> GetAccountInfo(LinkedInAuthenticationEventArgs authenticationEventArgs)
        {
            Uri url = new Uri(BaseAccessUrl + "/v1/people/~:(id,first-name,last-name,maiden-name,email-address)?format=json&oauth2_access_token=" + authenticationEventArgs.AccessToken);

            string result = await CallApi(url);

            //try
            //{
            //    JObject jobj = JObject.Parse(result);

            //    user.Username = jobj["firstName"].ToString() + " " + jobj["lastName"].ToString();
            //    user.Email = jobj["emailAddress"].ToString();
            //}
            //catch (Exception ex)
            //{
            //    DiagnosticsHelper.Instance.WriteLine("LinkedInConnection GetAccountInfo error:" + ex.Message);
            //}

            this.GetAccountInfoCompleted(this, new LinkedInIdentificationEventArgs(authenticationEventArgs, result));
            return(true);
        }
Пример #2
0
 public LinkedInIdentificationEventArgs(LinkedInAuthenticationEventArgs authorization, string results)
 {
     this.AuthenticationEventArgs = authorization;
     this.Result = results;
 }
        public async Task<bool> GetAccountInfo(LinkedInAuthenticationEventArgs authenticationEventArgs)
        {
            Uri url = new Uri(BaseAccessUrl + "/v1/people/~:(id,first-name,last-name,maiden-name,email-address)?format=json&oauth2_access_token=" + authenticationEventArgs.AccessToken);

            string result = await CallApi(url);

            //try
            //{
            //    JObject jobj = JObject.Parse(result);

            //    user.Username = jobj["firstName"].ToString() + " " + jobj["lastName"].ToString();
            //    user.Email = jobj["emailAddress"].ToString();
            //}
            //catch (Exception ex)
            //{
            //    DiagnosticsHelper.Instance.WriteLine("LinkedInConnection GetAccountInfo error:" + ex.Message);
            //}

            this.GetAccountInfoCompleted(this, new LinkedInIdentificationEventArgs(authenticationEventArgs, result));
            return true;
        }
		public LinkedInIdentificationEventArgs(LinkedInAuthenticationEventArgs authorization, string results)
		{
			this.AuthenticationEventArgs = authorization;
			this.Result = results;
		}