public void StopServer(bool graceful = false) { if (graceful) { connector.Stop(); connector = null; } else { connector.Kill(); connector = null; } }
private void btnStopNetCore_Click(object sender, EventArgs e) { if (connector == null || connector.Disposed) { MessageBox.Show("connector is null"); return; } btnStopNetCore.Enabled = false; connector?.Stop(); connector = null; btnStopNetCore.Enabled = true; }