Пример #1
0
 public void Dispose()
 {
     pollingTimer?.Stop();
     pollingTimer = null;
     gocdService?.Dispose();
     gocdService = null;
 }
Пример #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);
        }
Пример #3
0
 public ServiceManager(IGocdServiceFactory gocdServiceFactory)
 {
     this.gocdServiceFactory = gocdServiceFactory;
     this.gocdService        = gocdServiceFactory.Create(GetConnectionInfo());
 }