Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        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
            });
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
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);
      }
Ejemplo n.º 6
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;
      }