コード例 #1
0
        /// <summary>
        /// Prevents a default instance of the <see cref="CrontabField"/> class from being created.
        /// </summary>
        /// <param name="impl">The impl<see cref="CrontabFieldImpl"/></param>
        /// <param name="expression">The expression<see cref="string"/></param>
        private CrontabField(CrontabFieldImpl impl, string expression)
        {
            _impl = impl ?? throw new ArgumentNullException(nameof(impl));
            _bits = new BitArray(impl.ValueCount);

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

            _impl.Parse(expression, Accumulate);
        }
コード例 #2
0
 /// <summary>
 /// Parses a crontab field expression given its kind.
 /// </summary>
 /// <param name="kind">The kind<see cref="CrontabFieldKind"/></param>
 /// <param name="expression">The expression<see cref="string"/></param>
 /// <returns>The <see cref="CrontabField"/></returns>
 public static CrontabField Parse(CrontabFieldKind kind, string expression)
 {
     return(new CrontabField(CrontabFieldImpl.FromKind(kind), expression));
 }