private List<Friend> buildFriendsEntryList(XmlDocument x) { XmlNodeList msgsNodes = x.SelectNodes("/response/user"); if (msgsNodes.Count>0) { List<Friend> friendList = new List<Friend>(); foreach (XmlNode msgNode in msgsNodes) { Friend friend = new Friend(); XmlUtils.UseNode(msgNode); friend.Id = XmlUtils.Int(FriendFields.Id); friend.FirstName = XmlUtils.String(FriendFields.FirstName); friend.LastName = XmlUtils.String(FriendFields.LastName); friend.NickName = XmlUtils.String(FriendFields.NickName); friend.Rating = XmlUtils.Int(FriendFields.Rating); friend.Sex = (FriendSex)XmlUtils.Int(FriendFields.Sex); friend.BirthDate = XmlUtils.String(FriendFields.BirthDate); friend.City = XmlUtils.Int(FriendFields.City); friend.Country = XmlUtils.Int(FriendFields.Country); friend.Timezone = XmlUtils.String(FriendFields.Timezone); friend.Photo = XmlUtils.String(FriendFields.Photo); friend.PhotoMedium = XmlUtils.String(FriendFields.PhotoMedium); friend.PhotoBig = XmlUtils.String(FriendFields.PhotoBig); friend.Online = XmlUtils.Bool(FriendFields.Online); friend.Lists = this.buildFriendsList(msgNode.SelectNodes("lists/list/item")); friend.Domain = XmlUtils.String(FriendFields.Domain); friend.HomePhone = XmlUtils.String(FriendFields.HomePhone); friend.MobilePhone = XmlUtils.String(FriendFields.MobilePhone); friend.HasMobile = XmlUtils.Bool(FriendFields.HasMobile); friend.University = XmlUtils.Int(FriendFields.University); friend.UniversityName = XmlUtils.String(FriendFields.UniversityName); friend.Faculty = XmlUtils.Int(FriendFields.Faculty); friend.FacultyName = XmlUtils.String(FriendFields.FacultyName); friend.Graduation = XmlUtils.Int(FriendFields.Graduation); friendList.Add(friend); } return friendList; } return null; }
private void FriendList_SelectedIndexChanged(object sender, EventArgs e) { this.selectedFriend = this.friendList[((ListBox)sender).SelectedIndex]; this.LoadUserAlbums(this.selectedFriend.Id); }
private void downloadAllFriendsPhotosToolStripMenuItem_Click(object sender, EventArgs e) { this.FriendsProgress.Maximum = this.friendList.Count; this.FriendsProgress.Value = 0; foreach (Friend f in this.friendList) { this.selectedFriend = f; this.LoadUserAlbums(f.Id); foreach(AlbumEntry a in this.albumList) { this.LoadAlbumPhotos(a); } this.FriendsProgress.Value++; } }
private List<Friend> buildOnlineFriendsEntryList(XmlDocument x) { XmlNodeList msgsNodes = x.SelectNodes("/response/uid"); if (msgsNodes.Count > 0) { List<Friend> onlineFriendList = new List<Friend>(); Console.WriteLine(msgsNodes.Count); foreach (XmlNode n in msgsNodes) { Friend friend = new Friend(); XmlUtils.UseNode(n); friend.Id = XmlUtils.IntVal(); onlineFriendList.Add(friend); } return onlineFriendList; } return null; }