Beispiel #1
0
        // you have ben removed from friends
        private async void RemovedFromeFriends(string login, DateTime time)
        {
            await System.Threading.Tasks.Task.Run(() =>
                                                  System.Threading.Thread.Sleep(Properties.Settings.Default.ActionDelayMsec));

            FriendsList.Remove(FriendsList.FirstOrDefault(x => x.Name.Equals(login)));
        }
Beispiel #2
0
        // your request for friendship accepted
        private async void FriendshipAccepted(string login, DateTime time)
        {
            await System.Threading.Tasks.Task.Run(() =>
                                                  System.Threading.Thread.Sleep(Properties.Settings.Default.ActionDelayMsec));

            if (FriendsList.FirstOrDefault(x => x.Name.Equals(login)) == null)
            {
                FriendsList.Add(new Friend(client, login, true));
            }
        }
Beispiel #3
0
        // update friend status
        private void FriendGoOffline(string login)
        {
            if (!string.IsNullOrEmpty(login))
            {
                Friend f = FriendsList.FirstOrDefault(x => x.Name.Equals(login));

                if (f != null)
                {
                    f.IsOnline = false;
                }
            }
        }
Beispiel #4
0
        // update conversations
        private void NewReply(string interlocutor, ConversationReply reply)
        {
            if (SelectedFriend != null && interlocutor == SelectedFriend.Name)
            {
                RepliesList.Add(new Reply(reply, client.Name));
            }
            else
            {
                Friend f = FriendsList.FirstOrDefault(x => x.Name.Equals(interlocutor));

                if (f != null)
                {
                    f.HasUnreadMessages = true;
                }
            }
        }