public void Disconnect() { try { client.Disconnect(); } catch (Exception exception) { // Ignore any error client.Abort(); TriggerConnectionFailed(exception); } }
void DisconnectUser() { if (isConnected) { client.Disconnect(ID); client = null; tbUserName.IsEnabled = true; btnConDiscon.Content = "Connect"; isConnected = false; } }
void DisconnectUser() { if (isConnected) { client.Disconnect(ID); client = null; txtUserName.IsEnabled = true; btnConnect.Content = "Подключиться"; isConnected = false; } }
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))); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { proxy.Disconnect(); }