public static TriggerBuilder WithSimpleSchedule(this TriggerBuilder triggerBuilder, Action <SimpleScheduleBuilder> action)
        {
            SimpleScheduleBuilder builder = SimpleScheduleBuilder.Create();

            action(builder);
            return(triggerBuilder.WithSchedule(builder));
        }
Exemple #2
0
        /// <summary>
        /// Produce the <see cref="ITrigger" />.
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <returns>a Trigger that meets the specifications of the builder.</returns>
        public ITrigger Build()
        {
            if (scheduleBuilder == null)
            {
                scheduleBuilder = SimpleScheduleBuilder.Create();
            }
            IMutableTrigger trig = scheduleBuilder.Build();

            trig.CalendarName = calendarName;
            trig.Description  = description;
            trig.StartTimeUtc = startTime;
            trig.EndTimeUtc   = endTime;
            if (key == null)
            {
                key = new TriggerKey(Guid.NewGuid().ToString(), null);
            }
            trig.Key = key;
            if (jobKey != null)
            {
                trig.JobKey = jobKey;
            }
            trig.Priority = priority;

            if (!jobDataMap.IsEmpty)
            {
                trig.JobDataMap = jobDataMap;
            }

            return(trig);
        }
Exemple #3
0
        public static IServiceCollectionTriggerConfigurator WithSimpleSchedule(this IServiceCollectionTriggerConfigurator triggerBuilder, Action <SimpleScheduleBuilder>?action = null)
        {
            SimpleScheduleBuilder builder = SimpleScheduleBuilder.Create();

            action?.Invoke(builder);
            triggerBuilder.WithSchedule(builder);
            return(triggerBuilder);
        }
Exemple #4
0
 public static TriggerBuilder WithSimpleSchedule(this TriggerBuilder triggerBuilder)
 {
     SimpleScheduleBuilder builder = SimpleScheduleBuilder.Create();
     return triggerBuilder.WithSchedule(builder);
 }