Ejemplo n.º 1
0
 private static CronRange ParseRangeExpression(CronField cronField, string rangeExpression)
 {
     try
     {
         var range = rangeExpression.Split('-');
         return new CronRange(cronField.ValueToIndex(Int32.Parse(range[UpperIndex])), cronField.ValueToIndex(Int32.Parse(range[LowerIndex])));
     }
     catch (FormatException ex)
     {
         throw new CronException("The range expression is incorrectly formatted.", ex);
     }
 }
Ejemplo n.º 2
0
        public static CronRange FromExpression(CronField cronField, string rangeExpression)
        {
            Mandate.ParameterNotNullOrEmpty(rangeExpression, "rangeExpression");
            int parsed;

            if(Int32.TryParse(rangeExpression, out parsed))
            {
                return new CronRange(cronField.ValueToIndex(parsed), cronField.ValueToIndex(parsed));
            }

            return ParseRangeExpression(cronField, rangeExpression);
        }
Ejemplo n.º 3
0
 public CronValueExpression(string expression, CronField cronField)
 {
     this.cronField = cronField;
     Parse(cronField.ReplaceTextWithNumbers(expression));
 }