public void StartJob( string workingDirectory, string filename, int secInterval) { var job = new Job(workingDirectory, filename, secInterval); if (secInterval > 0) { reserveId(job); saveJobs(); } job.Start(); }
void reserveId(Job job) { lock (jobTable) { // Find an available id. var id = 0; while (jobTable.ContainsKey(++id)) ; // Create a new entry in the job table. jobTable.Add(id, job); } }
void startJobCore(Job job) { reserveId(job); job.Start(); }
public static void WriteErrorLine(Job job, string msg) => logLine(true, jobColor, job.ToString(), msg);
public static void WriteLine(Job job, string msg) => logLine(false, jobColor, job.ToString(), msg);