Beispiel #1
0
 private void CheckUser(VKFriendModel user)
 {
     if (user.photo == "http://vk.com/images/deactivated_c.gif")
     {
         user.photo = "/VK_Metro;component/Images/deactivated_c.png";
     }
     if (user.photo == "http://vk.com/images/camera_c.gif")
     {
         user.photo = "/VK_Metro;component/Images/camera_c.png";
     }
 }
Beispiel #2
0
 private void GetUser(string uid)
 {
     App.VK.GetUser(
         uid,
         result =>
     {
         VKFriendModel user = (VKFriendModel)result;
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             this.CheckUser(user);
             this.vkUsers.Add(user);
             this.NotifyPropertyChanged("VKMessage");
             this.NotifyPropertyChanged("VKDialogs");
         });
     },
         error =>
     {
     });
 }
 private void RadioButton_Checked(object sender, RoutedEventArgs e)
 {
     ListBoxItem checkedItem = FriendsList.ItemContainerGenerator.ContainerFromItem((sender as RadioButton).DataContext) as ListBoxItem;
     checkedFriend = checkedItem.DataContext as VKFriendModel;
 }
Beispiel #4
0
 private void CheckUser(VKFriendModel user)
 {
     if (user.photo == "http://vk.com/images/deactivated_c.gif")
         user.photo = "/VK_Metro;component/Images/deactivated_c.png";
     if (user.photo == "http://vk.com/images/camera_c.gif")
         user.photo = "/VK_Metro;component/Images/camera_c.png";
 }
Beispiel #5
0
 public void AddPossibleFriendsRequests(VKFriendModel[] requests)
 {
     var ids = requests.Aggregate("", (current, user) => current + user.uid + ',');
         ids = ids.Remove(ids.Length - 1);
         App.VK.GetUser(ids, result =>
         {
             var resultUsers = (VKFriendModel[])result;
             Deployment.Current.Dispatcher.BeginInvoke(() =>
             {
                 resultUsers.ToList().ForEach(
                     model =>
                         {
                             this.CheckUser(model);
                             this.possibleFriends.Add(model);
                         });
                 this.NotifyPropertyChanged("PossibleFriends");
             });
         }, error =>
         {
         });
 }
Beispiel #6
0
        /// <summary>
        /// Добавить друзей из vk.com
        /// </summary>
        /// <param name="vkFriends"></param>
        public void AddFriend(VKFriendModel[] vkFriends)
        {
            if (this.vkFriend.Any())
            {
                this.vkFriend.Clear();
            }

            foreach (var friend in vkFriends)
            {
                this.CheckUser(friend);
                this.vkFriend.Add(friend);
            }

            this.NotifyPropertyChanged("VKFriend");
        }
        private void RefreshGlobal(VKFriendModel[] result)
        {
            this.vkGlobal.Clear();
            foreach (var user in result)
            {
                this.vkGlobal.Add(user);
            }

            this.NotifyPropertyChanged("VKGlobal");
            this.NotifyPropertyChanged("OthersVisibility");
        }