コード例 #1
0
        /// <summary>
        /// Service logic method
        /// </summary>
        /// <param name="arg"></param>
        public void PresetJobDoWork(object arg)
        {
            int miliSecondsTimeOut = Convert.ToInt32(ConfigurationManager.AppSettings["MilisecondsTimeOut"]);

            for (; ; )
            {
                if (PresetJobDoWorkServiceStop.WaitOne(miliSecondsTimeOut))
                    return;

                try
                {
                    JobModel jobModel = new JobModel();
                    jobModel.CreateLapsedPresetCallLog();
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error has ocurred while running the Preset Watch Service!\n{0}\n{1}", ex.Message, ex.StackTrace));
                }
            }
        }