상속: IObjectReference
예제 #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);
        }
예제 #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));
        }
예제 #3
0
        private CrontabField(CrontabFieldImpl impl)
        {
            if (impl == null)
            {
                throw new ArgumentNullException("impl");
            }

            _impl = impl;
            _bits = new BitArray(impl.ValueCount);

            _bits.SetAll(false);
            _minValueSet = int.MaxValue;
            _maxValueSet = -1;
        }