private void Context_Closed() { if (InvokeRequired) { Invoke((MethodInvoker) delegate { Context_Closed(); }); return; } context.Message -= Context_Message; context.Closed -= Context_Closed; context.Close(); status.Text = "WebSocket closed."; }
private void ClientForm_FormClosed(object sender, FormClosedEventArgs e) { context.Message -= Context_Message; context.Closed -= Context_Closed; context.Close(); }