Пример #1
0
        private int setNumThread(aJob t)
        {
            int max;

            max         = maxNum() + 1;
            t.numThread = max;
            return(max);
        }
Пример #2
0
        public int addJob(TimerCallback method, object param, int timerBeforeStart)
        {
            aJob t;

            timerBeforeStart = Math.Max(0, timerBeforeStart);
            t          = new aJob(method, param, timerBeforeStart);
            t.deleted += new aJob.delegateDeleted(oneDeleted);
            _listThread.Add(t);
            return(setNumThread(t));
        }
Пример #3
0
        private void oneDeleted(int numThread)
        {
            aJob jobTrouve = null;

            foreach (aJob job in _listThread)
            {
                if (job.numThread == numThread)
                {
                    _listThread.Remove(job);
                    jobTrouve = job;
                    break;
                }
            }
            if (jobTrouve != null)
            {
                jobTrouve = null;
            }
        }