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