Example #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
                }
            }
        }