Beispiel #1
0
        private void ShowFriendOperatorWith()
        {
            if (selectedOperator == "Все" || selectedOperator == null)
            {
                return;
            }

            PhoneOperator phoneOperator = null;

            foreach (var item in PhoneOperators)
            {
                if (item.Name == selectedOperator)
                {
                    phoneOperator = item;
                }
            }
            if (phoneOperator == null)
            {
                return;
            }
            var tempList = CopyCollection(FriendsList);

            FriendsList.Clear();
            foreach (var friend in tempList)
            {
                if (phoneOperator.IsCodeContains(friend.NumberCode))
                {
                    FriendsList.Add(friend);
                }
            }
        }
Beispiel #2
0
 public void BnetFriendReceived(BnetFriend friend)
 {
     DispatcherHelper.CheckBeginInvokeOnUI(() =>
     {
         FriendsList.Add(friend);
     });
 }
Beispiel #3
0
        private void ShowFriendSelectedMonth()
        {
            if (selectedMonth == "Все" || selectedMonth == null)
            {
                return;
            }
            int month;

            try
            {
                month = Convert.ToInt32(selectedMonth);
            } catch
            {
                return;
            }
            var tempList = CopyCollection(FriendsList);

            FriendsList.Clear();
            foreach (var friend in tempList)
            {
                if (friend.Month == month)
                {
                    FriendsList.Add(friend);
                }
            }
        }
Beispiel #4
0
        public async Task AddFriendToFriendsListAsync(User user)
        {
            DependencyService.Get <IFirebaseDatabase>().AddFriend(user);
            await App.Current.MainPage.DisplayAlert("Successful Message", "New friend added", "Ok");

            FriendsList.Add(user);
        }
Beispiel #5
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));
            }
        }
        /// <summary>
        /// 添加好友
        /// </summary>
        /// <returns></returns>
        public void AddFriend(int uid)
        {
            FriendData fd = FriendsList.Find(t => (t.UserId == uid));

            if (fd == null)
            {
                fd = new FriendData()
                {
                    UserId     = uid,
                    IsGiveAway = false
                };
                FriendsList.Add(fd);
            }
        }
Beispiel #7
0
 private void ShowFriendsWithNumber()
 {
     if (isWithNumberOnly)
     {
         var tempList = CopyCollection(FriendsList);
         FriendsList.Clear();
         foreach (var friend in tempList)
         {
             if (friend.Number != 0)
             {
                 FriendsList.Add(friend);
             }
         }
     }
 }
Beispiel #8
0
        public async void UpdateFollowedUsers()
        {
            FriendsList.Clear();

            var user = App.User;

            foreach (var friendId in user.GetFollowedUsers())
            {
                var friend = await UserManager.Instance.GetUsersWhere(x => x.ID == friendId);

                if (friend[0] != null)
                {
                    var friendToAdd = friend[0];
                    FriendsList.Add(friendToAdd);
                }
            }
        }
Beispiel #9
0
 public void isFriendOf(Person p)
 {
     FriendsList.Add(p);
 }
Beispiel #10
0
 public void addFriend(Member friend)
 {
     FriendsList.Add(friend);
     //FriendsList.Add(new Friendship(friend));
 }