public void Start() { lock (timer) { if (Status == BackgroundServiceExecutorStatus.Paused || Status == BackgroundServiceExecutorStatus.Stopped) { if (Status == BackgroundServiceExecutorStatus.Stopped) { Status = BackgroundServiceExecutorStatus.Starting; current = (IBackgroundService)container.Resolve(backgroundServiceType); current.Initialize(moduleConfiguration); } Status = BackgroundServiceExecutorStatus.Running; current.Run(moduleConfiguration); timer.Change(interval, new TimeSpan(0, 0, 0, 0, -1)); } } }