コード例 #1
0
        public static Person FromElement(XElement e)
        {
            var p = new Person();
            try
            {
                p.created_on = e.Attribute("created_on").Value;
                p.id = e.Attribute("id").Value;
                p.is_contact = e.Attribute("is_contact").Value == "1";
                p.is_plus = e.Attribute("is_plus").Value == "1";
                p.is_staff = e.Attribute("is_staff").Value == "1";
                p.is_subscribed_to = e.Attribute("is_subscribed_to").Value == "1";
                p.username = e.Element("username").Value;
                p.display_name = e.Element("display_name").Value;
                p.location = e.Element("location").Value;
                p.url = e.Element("url").Value;
                p.bio = e.Element("bio").Value;
                p.number_of_contacts = int.Parse(e.Element("number_of_contacts").Value);
                p.number_of_uploads = int.Parse(e.Element("number_of_uploads").Value);
                p.number_of_videos = int.Parse(e.Element("number_of_videos").Value);
                p.number_of_videos_appears_in = int.Parse(e.Element("number_of_videos_appears_in").Value);
                p.number_of_albums = int.Parse(e.Element("number_of_albums").Value);
                p.number_of_channels = int.Parse(e.Element("number_of_channels").Value);
                p.number_of_groups = int.Parse(e.Element("number_of_groups").Value);
                p.number_of_likes = int.Parse(e.Element("number_of_likes").Value);
                p.profileurl = e.Element("profileurl").Value;
                p.videosurl = e.Element("videosurl").Value;

                p.portraits = GetPortraits(e.Element("portraits"));
            }
            catch
            {  }
            return p;
        }
コード例 #2
0
 public bool Login()
 {
     if (string.IsNullOrEmpty(Token) || string.IsNullOrEmpty(TokenSecret))
         return false;
     var loginResponse = vimeo_test_login();
     if (loginResponse.stat != "ok") return false;
     if (Me == null)
         if ((Me = vimeo_people_getInfo(UserId)) == null) return false;
     UserId = loginResponse.userid;
     UserName = loginResponse.username;
     return true;
 }