private void share(string accessToken, LinkedInSocialUserInfo liUserInfo, string text) { string body = SHAREBODY_TEMPLATE.Args(text); XDocument responseDoc = WebClient.GetXML(SHARE_BASEURL, this, new Dictionary <string, string>() { { OAUTH2ACCESSTOKEN_PARAMNAME, accessToken } }, body); }
protected override void DoPostMessage(string text, SocialUserInfo userInfo) { if (userInfo.LoginState != SocialLoginState.LoggedIn) { return; } LinkedInSocialUserInfo liUserInfo = userInfo as LinkedInSocialUserInfo; share(liUserInfo.AccessToken, liUserInfo, text); }
private void share(string accessToken, LinkedInSocialUserInfo liUserInfo, string text) { string body = SHAREBODY_TEMPLATE.Args(text); var responseDoc = WebClient.GetXML(SHARE_BASEURL, new WebClient.RequestParams(this) { Headers = new Dictionary <string, string>() { { OAUTH2ACCESSTOKEN_PARAMNAME, accessToken } }, Body = body }); }
private void getUserInfo(LinkedInSocialUserInfo liUserInfo) { XDocument responseDoc = WebClient.GetXML(GETUSERINFO_BASEURL, this, HTTPRequestMethod.GET, new Dictionary <string, string>() { { OAUTH2ACCESSTOKEN_PARAMNAME, liUserInfo.AccessToken } }); XElement person = responseDoc.Element(USERINFO_PERSON_PARAMNAME); XElement id = person.Element(USERINFO_ID_PARAMNAME); XElement email = person.Element(USERINFO_EMAIL_PARAMNAME); XElement firstName = person.Element(USERINFO_FIRSTNAME_PARAMNAME); XElement lastName = person.Element(USERINFO_LASTNAME_PARAMNAME); liUserInfo.LoginState = SocialLoginState.LoggedIn; liUserInfo.ID = id.Value; liUserInfo.Email = email.Value; liUserInfo.FirstName = firstName.Value; liUserInfo.LastName = lastName.Value; }
private void share(string accessToken, LinkedInSocialUserInfo liUserInfo, string text) { string body = SHAREBODY_TEMPLATE.Args(text); XDocument responseDoc = WebClient.GetXML(SHARE_BASEURL, this, new Dictionary<string, string>() {{OAUTH2ACCESSTOKEN_PARAMNAME, accessToken}}, body); }
private void getUserInfo(LinkedInSocialUserInfo liUserInfo) { XDocument responseDoc = WebClient.GetXML(GETUSERINFO_BASEURL, this, HTTPRequestMethod.GET, new Dictionary<string, string>() { {OAUTH2ACCESSTOKEN_PARAMNAME, liUserInfo.AccessToken} }); XElement person = responseDoc.Element(USERINFO_PERSON_PARAMNAME); XElement id = person.Element(USERINFO_ID_PARAMNAME); XElement email = person.Element(USERINFO_EMAIL_PARAMNAME); XElement firstName = person.Element(USERINFO_FIRSTNAME_PARAMNAME); XElement lastName = person.Element(USERINFO_LASTNAME_PARAMNAME); liUserInfo.LoginState = SocialLoginState.LoggedIn; liUserInfo.ID = id.Value; liUserInfo.Email = email.Value; liUserInfo.FirstName = firstName.Value; liUserInfo.LastName = lastName.Value; }