private async void ResetDiscovery() { await _discoveryClient.StopAsync(); RegisteredServices.Clear(); _discoveryClient.HubUrl = HubUrl; _discoveryClient.Credentials = new DemoCredentials() { Name = ClientID }; try { IsFree = false; await _discoveryClient.StartAsync(); } catch (Exception ex) { Logger.LogError(ex, "Error starting discovery service. Make sure the remote SignalR Hub is running."); } finally { IsFree = true; } }
public static void Reset() { foreach (var service in RegisteredServices) { if (service.Value != null && service.Value is IDisposable disposableService) { disposableService.Dispose(); } } Inited = false; RegisteredServices.Clear(); RegisteredServices = new Dictionary <string, object>(); }
private void ClearConnection() { IsConnected = false; InvokeUI(async() => { RegisteredServices.Clear(); _discoveryClient.Credentials = new DemoCredentials() { Name = ClientID }; _discoveryClient.HubUrl = HubUrl; await _discoveryClient.StartAsync(); }); }
public static void Reset() { Inited = false; RegisteredServices.Clear(); RegisteredServices = new Dictionary <string, object>(); }