예제 #1
0
 private void RemoveInvite(InviteViewModel invite)
 {
     for (int i = 0; i < Invites.Count; i++)
     {
         if (Invites[i] == invite)
         {
             Invites.RemoveAt(i);
         }
     }
 }
예제 #2
0
        private void OnNewInvite(AndersonInvite invite)
        {
            var inVM = new InviteViewModel(invite);

            inVM.InviteProcessed += ProcessInvite;
            if (App.Current?.Dispatcher == null || App.Current.Dispatcher.CheckAccess())
            {
                Invites.Add(inVM);
            }
            else
            {
                App.Current.Dispatcher.Invoke(() => Invites.Add(inVM));
            }
        }
예제 #3
0
        private void ProcessInvite(InviteViewModel invite, bool accept)
        {
            if (LogoutStatus != "Logout")
            {
                return;
            }

            RemoveInvite(invite);
            if (accept)
            {
                _roomBack.JoinRoomAsync(invite.Invite.Room);
            }
            else
            {
                _roomBack.RejectInviteAsync(invite.Invite.Room);
            }
        }