Example #1
0
 public void Disconnect()
 {
     try {
         client.Disconnect();
     } catch (Exception exception) {
         // Ignore any error
         client.Abort();
         TriggerConnectionFailed(exception);
     }
 }
Example #2
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         tbUserName.IsEnabled = true;
         btnConDiscon.Content = "Connect";
         isConnected          = false;
     }
 }
Example #3
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         txtUserName.IsEnabled = true;
         btnConnect.Content    = "Подключиться";
         isConnected           = false;
     }
 }
Example #4
0
 private void Disconnect()
 {
     try
     {
         _chatClient.Disconnect();
         _chatClient.Close();
     }
     catch (Exception e)
     {
         _dispatcher.Invoke(new Action(() => AppendText(String.Format("Couldn't establish connection to server. {0} {1}", e.Message, e.InnerException != null ? e.InnerException.Message : ""), Colors.Red)));
         _dispatcher.Invoke(new Action(() => EnableChat(false)));
         _dispatcher.Invoke(new Action(() => EnableConnect(true)));
         _dispatcher.Invoke(new Action(() => EnableDisconnect(false)));
     }
 }
Example #5
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     proxy.Disconnect();
 }