Ejemplo n.º 1
0
 private void RaiseFriendListReseted()
 {
     FriendListChanged?.Invoke(this,
                               new FriendListChangedEventArgs {
         FriendNumber = -1, Action = FriendListChangedAction.Reset
     });
 }
Ejemplo n.º 2
0
        private void OnFriendListChanged(bool force)
        {
            var list = Friends.Values.Where(u => !u.IsOffline && u.Status != null).OrderBy(u => u.GetValue()).ToList();

            if (FriendList == null || force || !list.SequenceEqual(FriendList))
            {
                FriendList = list.AsEnumerable();
                FriendListChanged?.Invoke(this, new EventArgs());
                Tick?.Invoke(this, new EventArgs());
            }
            //for (int i = 0; i < Math.Max(FriendList.Count, list.Count); i++) {
            //  if (i >= list.Count) {
            //    FriendList.RemoveAt(i);
            //    i--;
            //  } else if (i == FriendList.Count) {
            //    FriendList.Add(list[i]);
            //  } else if (force || FriendList[i] != list[i]) {
            //    FriendList[i] = list[i];
            //  }
            //}
        }
Ejemplo n.º 3
0
        private async void FriendListChangedHandler(object sender, FriendListChangedEventArgs e)
        {
            await SaveDataAsync();

            FriendListChanged?.Invoke(this, e);
        }