Beispiel #1
0
        /// <summary>
        /// Applies the appropriate misfire handling policy.
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="instruction"></param>
        void ApplyMisfireHandlingInstruction(SimpleScheduleBuilder builder, ScheduleMisfirePolicy instruction)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            switch (instruction)
            {
            case ScheduleMisfirePolicy.Default:
                // apply no policy, use whatever is set by default
                break;

            case ScheduleMisfirePolicy.FireNow:
                builder.WithMisfireHandlingInstructionFireNow();
                break;

            case ScheduleMisfirePolicy.Ignore:
                builder.WithMisfireHandlingInstructionIgnoreMisfires();
                break;

            case ScheduleMisfirePolicy.NextWithExistingCount:
                builder.WithMisfireHandlingInstructionNextWithExistingCount();
                break;

            case ScheduleMisfirePolicy.NextWithRemainingCount:
                builder.WithMisfireHandlingInstructionNextWithRemainingCount();
                break;

            case ScheduleMisfirePolicy.NowWithExistingRepeatCount:
                builder.WithMisfireHandlingInstructionNowWithExistingCount();
                break;

            case ScheduleMisfirePolicy.NowWithRemainingRepeatCount:
                builder.WithMisfireHandlingInstructionNowWithRemainingCount();
                break;
            }
        }