Exemplo n.º 1
0
        private void RowButtonEditNickname_Click(object sender, RoutedEventArgs args)
        {
            CscUserMainData data = ((FrameworkElement)sender).DataContext as CscUserMainData;

            if (client.FriendsList.FirstOrDefault(u => u.Id == data.Id) != null)
            {
                FriendsListEditWindow window = new FriendsListEditWindow(FriendsListDataGrid, client, data, true);
                window.ShowDialog();
            }
        }
Exemplo n.º 2
0
        private void RowButtonRemoveFriend_Click(object sender, RoutedEventArgs args)
        {
            CscUserMainData data = ((FrameworkElement)sender).DataContext as CscUserMainData;

            if (!String.IsNullOrEmpty(data.FriendName))
            {
                client.SendRemoveUserFromFriendsListDataRequestEncrypted(new CscChangeFriendData {
                    Id = data.Id, FriendName = data.FriendName
                });
                client.SearchedUsers.Remove(data);
                data.FriendName   = String.Empty;
                data.CanBeRemoved = false;
                data.IsNotFriend  = true;
                client.SearchedUsers.Add(data);
            }
            else
            {
                FriendsListEditWindow window = new FriendsListEditWindow(FriendsListDataGrid, client, data, false);
                window.ShowDialog();
            }
        }