예제 #1
0
        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);
        }
예제 #2
0
        protected override void DoPostMessage(string text, SocialUserInfo userInfo)
        {
            if (userInfo.LoginState != SocialLoginState.LoggedIn)
            {
                return;
            }

            LinkedInSocialUserInfo liUserInfo = userInfo as LinkedInSocialUserInfo;

            share(liUserInfo.AccessToken, liUserInfo, text);
        }
예제 #3
0
파일: LinkedIn.cs 프로젝트: uzbekdev1/nfx
        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
            });
        }
예제 #4
0
        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;
        }
예제 #5
0
파일: LinkedIn.cs 프로젝트: vlapchenko/nfx
      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);
      }
예제 #6
0
파일: LinkedIn.cs 프로젝트: vlapchenko/nfx
      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;
      }