Пример #1
0
 private void timer_Elapsed(object sender, ScheduledEventArgs e)
 {
     if (e == null)
     {
         return;
     }
     label1.Text = e.EventTime.ToString();
     Application.DoEvents();
     System.Threading.Thread.Sleep(100);
 }
Пример #2
0
 protected virtual void ExecuteCommand(object sender, ScheduledEventArgs e)
 {
     try
     {
         PublisherServiceMonitor._logger.Info((object)"BEGIN - ExecuteCommand");
         foreach (CommandArgs args in (List <CommandArgs>)sender)
         {
             new RestartServiceCommand().Execute(args);
         }
     }
     catch (Exception ex)
     {
         PublisherServiceMonitor._logger.Error((object)"ERROR - ExecuteCommand", ex);
     }
     finally
     {
         PublisherServiceMonitor._logger.Info((object)"END - ExecuteCommand");
     }
 }
Пример #3
0
        private void Scheduler_Scheduled(object sender, ScheduledEventArgs e)
        {
            //获取调度器的基本信息内容(不需包含状态信息)
            var content = SchedulerCommand.GetInfo((IScheduler)sender, false);

            content.Prepend(Properties.Resources.Scheduler_Scheduled_Name)
            .After(CommandOutletColor.DarkGray, "(")
            .After(CommandOutletColor.DarkCyan, e.ScheduleId)
            .After(CommandOutletColor.DarkGray, "): ")
            .After(CommandOutletColor.Magenta, e.Count.ToString() + " ");

            if (e.Triggers != null && e.Triggers.Length > 0)
            {
                content.AppendLine();

                for (int i = 0; i < e.Triggers.Length; i++)
                {
                    content.Append(CommandOutletColor.DarkYellow, $"[{i + 1}] ")
                    .AppendLine(e.Triggers[i].ToString());
                }
            }

            this.Context.Output.WriteLine(content.First);
        }
Пример #4
0
        private void timer_Elapsed(object sender, ScheduledEventArgs e)
        {
            Form2 frm2 = new Form2();

            frm2.Show();
        }
Пример #5
0
 private void Timer_Elapsed(object sender, ScheduledEventArgs e)
 {
     this.jobManagement.StartAllJobs();
 }