예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <param name="_trd"></param>
        /// <returns></returns>
        public static TimerTaskService CreateTimerTaskService(TimerInfo info, Action _trd)
        {
            TimerTaskService tus = new TimerTaskService(info, _trd);

            //创建启动线程
            tus.TaskService = new Task(() => tus.Run(tus.ct));
            return(tus);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <param name="_ptrd"></param>
        /// <param name="parm"></param>
        /// <returns></returns>
        public static TimerTaskService CreateTimerTaskService(TimerInfo info, Action <object> _ptrd, object parm)
        {
            TimerTaskService tus = new TimerTaskService(info, _ptrd);

            tus.setParm(parm);

            //创建启动线程
            tus.TaskService = new Task(() => tus.Run(tus.ct));
            return(tus);
        }