/// <summary>
 /// Returns a new instance of DateTime based on the provided date where the time is set to midnight
 /// </summary>
 /// <param name="date"></param>
 /// <returns></returns>
 public static DateTime AtMidnight(this DateTime date)
 {
     return date.At(0);
 }
 /// <summary>
 /// Returns a new instance of DateTime based on the provided date where the time is set to noon
 /// </summary>
 /// <param name="date"></param>
 /// <returns></returns>
 public static DateTime AtNoon(this DateTime date)
 {
     return date.At(12);
 }
Example #3
0
 /// <summary>
 /// Creates a new schedule executing once every week.
 /// </summary>
 /// <param name="service">The service to which the schedule should be added.</param>
 /// <returns>A part that allows chained fluent method calls.</returns>
 public static SchedulePart Weekly(this SchedulingService service)
 {
     return service.At("22 4 * * 0");
 }
Example #4
0
 /// <summary>
 /// Creates a new schedule executing once every month.
 /// </summary>
 /// <param name="service">The service to which the schedule should be added.</param>
 /// <returns>A part that allows chained fluent method calls.</returns>
 public static SchedulePart Monthly(this SchedulingService service)
 {
     return service.At("42 4 1 * *");
 }
Example #5
0
 /// <summary>
 /// Creates a new schedule executing once every hour.
 /// </summary>
 /// <param name="service">The service to which the schedule should be added.</param>
 /// <returns>A part that allows chained fluent method calls.</returns>
 public static SchedulePart Hourly(this SchedulingService service)
 {
     return service.At("01 * * * *");
 }
Example #6
0
 /// <summary>
 /// Creates a new schedule executing once every day.
 /// </summary>
 /// <param name="service">The service to which the schedule should be added.</param>
 /// <returns>A part that allows chained fluent method calls.</returns>
 public static SchedulePart Daily(this SchedulingService service)
 {
     return service.At("02 4 * * *");
 }
Example #7
0
 /// <summary>
 /// Creates a new schedule based on a crontab expression (eg: 0 0 * * *).
 /// Please refer to the project wiki for examples.
 /// </summary>
 /// <param name="service">The service to which the schedule should be added.</param>
 /// <param name="crontab">A crontab expression describing the schedule.</param>
 /// <returns>A part that allows chained fluent method calls.</returns>
 public static SchedulePart At(this SchedulingService service, string crontab)
 {
     var schedule = CrontabSchedule.Parse(crontab);
     return service.At(schedule.GetNextOccurrence);
 }
Example #8
0
 public static DateTime At(this DateTime dateTime, int hours, int minutes, int seconds)
 {
     return dateTime.At(new TimeSpan(hours, minutes, seconds));
 }
Example #9
0
 public static DateTime At(this DateTime d, int hour, int minute)
 {
     return d.At(hour, minute, 0);
 }
Example #10
0
 public static DateTime At(this DateTime d, int hour)
 {
     return d.At(hour, 0, 0);
 }
 public static CodeGen At(this CodeGen cg, SourceSpan span)
 {
     return cg.At(span.Location.Line + 1, span.Location.Column, span.Location.Line + 1, span.Location.Column + span.Length);
 }