Пример #1
0
 private void OnDeleteSenderCommandExecute(object p)
 {
     if (!(p is Sender sender))
     {
         return;
     }
     Senders.Remove(sender);
 }
Пример #2
0
 private async Task DeleteSender()
 {
     if (SelectedSender != null)
     {
         _senderService.Delete(SelectedSender);
         Messenger.Default.Send(SelectedSender);
         Senders.Remove(SelectedSender);
     }
 }
        public void RemoveClient(TcpClient client)
        {
            var sender = Senders.Where(p => p.Tcp != null && p.Tcp.Equals(client)).FirstOrDefault();

            if (sender != null)
            {
                sender.Tcp.Close();
                Senders.Remove(sender);
            }
        }