示例#1
0
 protected override void OnStop()
 {
     try
     {
         this.mHost.Close();
         TimerActivator.Stop();
     }
     catch (Exception e)
     {
         mLog.Error(e.ToString());
     }
 }
示例#2
0
        protected override void OnStart(string[] args)
        {
            Task.Run(() =>
            {
#if DEBUG
                while (File.Exists(@"C:\SQLAdmin.Timer.sleep"))
                {
                    Thread.Sleep(1000);
                }
#endif
                try
                {
                    this.mHost = new ServiceHost(typeof(ScheduleService));
                    this.mHost.Open();
                    TimerActivator.Start();
                }
                catch (Exception e)
                {
                    mLog.Error(e.ToString());
                }
            });
        }