Exemplo n.º 1
0
 private void parseMinutes(string taskName, int month, int day, int hour, IEnumerable <int> minutes)
 {
     if ((minutes.Count() == 1) && (minutes.ElementAt(0) == -1))
     {
         for (int i = 0; i <= 23; i++)
         {
             DateTime        dt = new DateTime(this.selectedDay.Year, month, day, hour, i, 0);
             CrontabInstance c  = new CrontabInstance();
             c.Date     = dt;
             c.TaskName = taskName;
             this.instances.Add(c);
         }
     }
     else
     {
         foreach (int minute in minutes)
         {
             DateTime        dt = new DateTime(this.selectedDay.Year, month, day, hour, minute, 0);
             CrontabInstance c  = new CrontabInstance();
             c.Date     = dt;
             c.TaskName = taskName;
             this.instances.Add(c);
         }
     }
 }
Exemplo n.º 2
0
 private void parseMinutes(string taskName, int month, int day, int hour, IEnumerable<int> minutes)
 {
     if ((minutes.Count() == 1) && (minutes.ElementAt(0) == -1))
     {
         for (int i = 0; i <= 23; i++)
         {
             DateTime dt = new DateTime(this.selectedDay.Year, month, day, hour, i, 0);
             CrontabInstance c = new CrontabInstance();
             c.Date = dt;
             c.TaskName = taskName;
             this.instances.Add(c);
         }
     }
     else
     {
         foreach (int minute in minutes)
         {
             DateTime dt = new DateTime(this.selectedDay.Year, month, day, hour, minute, 0);
             CrontabInstance c = new CrontabInstance();
             c.Date = dt;
             c.TaskName = taskName;
             this.instances.Add(c);
         }
     }
 }