Exemple #1
0
        public static ValueOrError <CrontabField> TryParse(CrontabFieldKind kind, string expression, ExceptionHandler onError)
        {
            var field = new CrontabField(CrontabFieldImpl.FromKind(kind));
            var error = field._impl.TryParse(expression, field.Accumulate, onError);

            return(error == null ? field : (ValueOrError <CrontabField>)error);
        }
Exemple #2
0
        public static T TryParse <T>(CrontabFieldKind kind, string expression, Func <CrontabField, T> valueSelector, Func <ExceptionProvider, T> errorSelector)
        {
            var field = new CrontabField(CrontabFieldImpl.FromKind(kind));
            var error = field._impl.TryParse(expression, field.Accumulate, null, e => e);

            return(error == null?valueSelector(field) : errorSelector(error));
        }