Example #1
0
 public BaseLink(
     TFieldDefinition fieldDefinition,
     IRangeFactoryLink successor)
 {
     FieldDefinition = fieldDefinition;
     Successor       = successor;
 }
Example #2
0
        public ICronRange Parse(string range)
        {
            IRangeFactoryLink currentLink = RangeFactoryChain.BuildChain();
            ICronRange        parsedRange = currentLink.HandleParse(range);

            while (parsedRange == null)
            {
                IRangeFactoryLink successor = currentLink.Successor;
                if (successor == null)
                {
                    throw new FormatException($"Failed to parse {range}");
                }

                currentLink = successor;
                parsedRange = currentLink.HandleParse(range);
            }

            return(parsedRange);
        }
Example #3
0
 public RangeValueLink(TFieldDefinition fieldDefinition, IRangeFactoryLink successor)
     : base(fieldDefinition, successor)
 {
 }
Example #4
0
 public NthDayOfWeekLink(DayOfWeekFieldDefinition fieldDefinition, IRangeFactoryLink successor)
     : base(fieldDefinition, successor)
 {
 }
Example #5
0
 public LastDayOfMonthLink(DayOfMonthFieldDefinition fieldDefinition, IRangeFactoryLink successor)
     : base(fieldDefinition, successor)
 {
 }
Example #6
0
 private void VerifyLinkIsExpected(IRangeFactoryLink rangeLink, Type expectedType)
 {
     Assert.IsInstanceOfType(rangeLink, expectedType);
     Assert.AreSame(TestObject, rangeLink.Successor);
 }
Example #7
0
 public NearestWeekdayLink(DayOfMonthFieldDefinition fieldDefinition, IRangeFactoryLink successor)
     : base(fieldDefinition, successor)
 {
 }
Example #8
0
 public WildcardLink(TFieldDefinition fieldDefinition, IRangeFactoryLink successor)
     : base(fieldDefinition, successor)
 {
 }
Example #9
0
 protected void VerifyAndIncrementTestRangeLink(Type expectedType)
 {
     Assert.IsInstanceOfType(TestRangeLink, expectedType);
     TestRangeLink = TestRangeLink.Successor;
 }
Example #10
0
 protected void SetTestRangeLinkToStartOfChain() => TestRangeLink = TestObject.BuildChain();
Example #11
0
 public static IRangeFactoryLink AddLastDayOfMonth(this IRangeFactoryLink rangeLink, DayOfMonthFieldDefinition fieldDefinition) =>
 new LastDayOfMonthLink(fieldDefinition, rangeLink);
Example #12
0
 public static IRangeFactoryLink AddNearestWeekday(this IRangeFactoryLink rangeLink, DayOfMonthFieldDefinition fieldDefinition) =>
 new NearestWeekdayLink(fieldDefinition, rangeLink);
Example #13
0
 public static IRangeFactoryLink AddNthDayOfWeek(this IRangeFactoryLink rangeLink, DayOfWeekFieldDefinition fieldDefinition) =>
 new NthDayOfWeekLink(fieldDefinition, rangeLink);
Example #14
0
 public static IRangeFactoryLink AddRangeValue <TFieldDefinition>(this IRangeFactoryLink rangeLink, TFieldDefinition fieldDefinition)
     where TFieldDefinition : ICronFieldDefinition => new RangeValueLink <TFieldDefinition>(fieldDefinition, rangeLink);
Example #15
0
 public static IRangeFactoryLink AddWildcard <TFieldDefinition>(this IRangeFactoryLink rangeLink, TFieldDefinition fieldDefinition)
     where TFieldDefinition : ICronFieldDefinition => new WildcardLink <TFieldDefinition>(fieldDefinition, rangeLink);