public void Stop() { foreach (var keyValuePair in _services) { keyValuePair.Value.Close(); keyValuePair.Value.Opened -= HostStateHandler; keyValuePair.Value.Closed -= HostStateHandler; keyValuePair.Value.Faulted -= HostStateHandler; } _services.Clear(); ServerStop?.Invoke(); }
private void CheckBoxEnable_CheckedChanged(object sender, EventArgs e) { CheckBox checkbox = sender as CheckBox; if (checkbox != null) { if (checkbox.Checked) { ServerStart?.Invoke(); } else { ServerStop?.Invoke(); } } }
private void InvokeServerStopEvent() { ServerStop?.Invoke(this, EventArgs.Empty); }
public static void OnServerStop(ServerStopEventArgs args) { ServerStop?.Invoke(args); }