Exemple #1
0
        private async void CheckInbox()
        {
            List <int> friendChanged = await Communications.FriendInbox();

            foreach (int i in friendChanged)
            {
                //update database!!!
                if (i >= 0)
                {
                    FriendEntity fe = await Communications.GetFriendEntity(i);

                    Constants.Friend.Friends.Add(fe);
                    View v = fe.GetView();
                    FriendList.Children.Add(v);
                }
                else
                {
                    foreach (FriendEntity fe in Constants.Friend.Friends)
                    {
                        if (fe.FriendID == i)
                        {
                            Constants.Friend.Friends.Remove(fe);
                            //undone
                        }
                    }
                    //delete friend
                }
            }
        }
Exemple #2
0
 public void addNewFriendView(FriendEntity newfriend)
 {
     FriendList.Children.Add(newfriend.GetView());
 }