Exemplo n.º 1
0
 public void Dispose()
 {
     pollingTimer?.Stop();
     pollingTimer = null;
     gocdService?.Dispose();
     gocdService = null;
 }
Exemplo n.º 2
0
        public void Restart()
        {
            pollingTimer?.Stop();
            gocdService?.Dispose();
            var connectionInfo = GetConnectionInfo();

            gocdService = gocdServiceFactory.Create(connectionInfo);
            PollAndUpdate();
            // timer does not cause re-entry
            pollingTimer = new DispatcherTimer(TimeSpan.FromSeconds(connectionInfo.PollingIntervalSeconds), DispatcherPriority.Normal, (sender, args) => PollAndUpdate(), Dispatcher.CurrentDispatcher);
        }
Exemplo n.º 3
0
 public ServiceManager(IGocdServiceFactory gocdServiceFactory)
 {
     this.gocdServiceFactory = gocdServiceFactory;
     this.gocdService        = gocdServiceFactory.Create(GetConnectionInfo());
 }