Exemple #1
0
        private JobWorker NewWorker(string name, bool show)
        {
            Debug.Assert(!workers.ContainsKey(name));

            JobWorker w = new JobWorker(mainForm);

            w.Name = name;
            w.WorkerFinishedJobs += new EventHandler(WorkerFinishedJobs);
            workers.Add(w.Name, w);
            summary.Add(w);
            mainForm.RegisterForm(w);
            return(w);
        }
Exemple #2
0
        /// <summary>
        /// created a new worker
        /// </summary>
        /// <param name="name">prefix of the worker name</param>
        /// <returns>the new worker</returns>
        private JobWorker NewWorker(string prefix)
        {
            int    num = 0;
            string name;

            do
            {
                name = prefix + " " + ++num;
            } while (workers.ContainsKey(name));

            JobWorker w = new JobWorker(mainForm);

            w.Name = name;
            w.WorkerFinishedJobs += new EventHandler(WorkerFinishedJobs);
            workers.Add(w.Name, w);
            summary.Add(w);
            return(w);
        }