Пример #1
0
 public void StartJob(
     string workingDirectory, string filename, int secInterval)
 {
     var job = new Job(workingDirectory, filename, secInterval);
     if (secInterval > 0)
     {
         reserveId(job);
         saveJobs();
     }
     job.Start();
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 void startJobCore(Job job)
 {
     reserveId(job);
     job.Start();
 }
Пример #4
0
 public static void WriteErrorLine(Job job, string msg)
     => logLine(true, jobColor, job.ToString(), msg);
Пример #5
0
 public static void WriteLine(Job job, string msg)
     => logLine(false, jobColor, job.ToString(), msg);