private void CloseChannel_Click(object sender, EventArgs e) { if (client != null) { if(client.State == CommunicationState.Opened) client.Close(); } }