Пример #1
0
        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;
            }
        }
Пример #2
0
 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>();
 }
Пример #3
0
        private void ClearConnection()
        {
            IsConnected = false;

            InvokeUI(async() =>
            {
                RegisteredServices.Clear();

                _discoveryClient.Credentials = new DemoCredentials()
                {
                    Name = ClientID
                };
                _discoveryClient.HubUrl = HubUrl;
                await _discoveryClient.StartAsync();
            });
        }
Пример #4
0
 public static void Reset()
 {
     Inited = false;
     RegisteredServices.Clear();
     RegisteredServices = new Dictionary <string, object>();
 }