public BaseLink( TFieldDefinition fieldDefinition, IRangeFactoryLink successor) { FieldDefinition = fieldDefinition; Successor = successor; }
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); }
public RangeValueLink(TFieldDefinition fieldDefinition, IRangeFactoryLink successor) : base(fieldDefinition, successor) { }
public NthDayOfWeekLink(DayOfWeekFieldDefinition fieldDefinition, IRangeFactoryLink successor) : base(fieldDefinition, successor) { }
public LastDayOfMonthLink(DayOfMonthFieldDefinition fieldDefinition, IRangeFactoryLink successor) : base(fieldDefinition, successor) { }
private void VerifyLinkIsExpected(IRangeFactoryLink rangeLink, Type expectedType) { Assert.IsInstanceOfType(rangeLink, expectedType); Assert.AreSame(TestObject, rangeLink.Successor); }
public NearestWeekdayLink(DayOfMonthFieldDefinition fieldDefinition, IRangeFactoryLink successor) : base(fieldDefinition, successor) { }
public WildcardLink(TFieldDefinition fieldDefinition, IRangeFactoryLink successor) : base(fieldDefinition, successor) { }
protected void VerifyAndIncrementTestRangeLink(Type expectedType) { Assert.IsInstanceOfType(TestRangeLink, expectedType); TestRangeLink = TestRangeLink.Successor; }
protected void SetTestRangeLinkToStartOfChain() => TestRangeLink = TestObject.BuildChain();
public static IRangeFactoryLink AddLastDayOfMonth(this IRangeFactoryLink rangeLink, DayOfMonthFieldDefinition fieldDefinition) => new LastDayOfMonthLink(fieldDefinition, rangeLink);
public static IRangeFactoryLink AddNearestWeekday(this IRangeFactoryLink rangeLink, DayOfMonthFieldDefinition fieldDefinition) => new NearestWeekdayLink(fieldDefinition, rangeLink);
public static IRangeFactoryLink AddNthDayOfWeek(this IRangeFactoryLink rangeLink, DayOfWeekFieldDefinition fieldDefinition) => new NthDayOfWeekLink(fieldDefinition, rangeLink);
public static IRangeFactoryLink AddRangeValue <TFieldDefinition>(this IRangeFactoryLink rangeLink, TFieldDefinition fieldDefinition) where TFieldDefinition : ICronFieldDefinition => new RangeValueLink <TFieldDefinition>(fieldDefinition, rangeLink);
public static IRangeFactoryLink AddWildcard <TFieldDefinition>(this IRangeFactoryLink rangeLink, TFieldDefinition fieldDefinition) where TFieldDefinition : ICronFieldDefinition => new WildcardLink <TFieldDefinition>(fieldDefinition, rangeLink);