/// <summary> /// Begin processing operations /// </summary> void StartITV2ADI_Engine() { _Timer = new System.Timers.Timer(Convert.ToInt32(ITV2ADI_CONFIG.ExpiredAssetCleanupIntervalHours) * 60 * 60 * 1000); _Timer.Elapsed += new ElapsedEventHandler(ElapsedTime); _Timer.Start(); ///fire on startup. ElapsedTime(IsProcessing, null); while (ConfigHandler <ITV2ADI_CONFIG> .B_IsRunning == true) { CleanTempDirectory(); string pollFiles = PollHandler.StartPolling(ITV2ADI_CONFIG.InputDirectory, ".itv"); if (!string.IsNullOrEmpty(pollFiles)) { log.Info(pollFiles); } if (PollHandler.B_FilesToProcess) { IsProcessing = false; ProcessQueuedItems(); } if (ConfigHandler <ITV2ADI_CONFIG> .B_IsRunning) { Thread.Sleep(Convert.ToInt32(ITV2ADI_CONFIG.PollIntervalInSeconds) * 1000); } } }