private void btnTestNew_Click(object sender, EventArgs e) { lblStatus.Text = "Running ..."; Application.DoEvents(); ScanManager.TaskManager mgr = new ScanManager.TaskManager(); mgr.ProcessQueue(); lblStatus.Text = "Done"; }
protected override void OnStart(string[] args) { LocalLog.AddLine("Starting the mutliprocessor scheduler service."); logEnvironment(); String path = MiscUtilities.AppParentPath() + Path.DirectorySeparatorChar; _taskManager = new ScanManager.TaskManager(); _CleanupLogs = _taskManager.CleanupLogs; _threadPool = new ScanManager.BackgroundProcessing[_taskManager.ThreadPoolSize]; try { LocalLog.AddLine("Starting Timer: Interval is 30 seconds"); _timer = new System.Timers.Timer(30000); // every 30 seconds _timer.Elapsed += new System.Timers.ElapsedEventHandler(pieJobCheck); _timer.Start(); LocalLog.AddLine("Service is running."); } catch (Exception ex) { LocalLog.AddLine("Error while starting timer. " + ex.Message); } }
public BackgroundProcessing(ScanManager.TaskManager tm) { _tm = tm; _bgw = new System.ComponentModel.BackgroundWorker(); _bgw.DoWork += BackgroundWorker_DoWork; }