示例#1
0
        public bool Change(int dueTime, int period)
        {
            if (dueTime < -1)
            {
                throw new ArgumentOutOfRangeException("dueTime");
            }

            if (period < -1)
            {
                throw new ArgumentOutOfRangeException("period");
            }

            if (runner == null)
            {
                return(false);
            }

            start_event.Reset();
            runner.Abort();
            runner.DueTime = dueTime;
            runner.Period  = period;
            start_event.Set();
            return(true);
        }