public override void AppendToTextEvaluation(DynamicTemplateValues currentValues, StringBuilder textBuilder, TemplateSegmentMatchResult previousMatchResult = null)
        {
            if (currentValues.CurrentYear < 1000 || currentValues.CurrentYear > 9999)
            {
                throw new ArgumentOutOfRangeException(nameof(currentValues), currentValues.CurrentYear, "Current year must be between 1000 and 9999, inclusive.");
            }

            textBuilder.Append(currentValues.CurrentYear);
        }
Example #2
0
 public abstract void AppendToTextEvaluation(DynamicTemplateValues currentValues, StringBuilder textBuilder, TemplateSegmentMatchResult previousMatchResult = null);
Example #3
0
 public override void AppendToTextEvaluation(DynamicTemplateValues currentValues, StringBuilder textBuilder, TemplateSegmentMatchResult previousMatchResult = null)
 {
     textBuilder.Append(Text);
 }
 public override void AppendToTextEvaluation(DynamicTemplateValues currentValues, StringBuilder textBuilder, TemplateSegmentMatchResult previousMatchResult = null)
 {
     textBuilder.Append((previousMatchResult as MatchResult)?.TrimmedName ?? DefaultName);
 }
Example #5
0
 public override void AppendToTextEvaluation(DynamicTemplateValues currentValues, StringBuilder textBuilder, TemplateSegmentMatchResult previousMatchResult = null)
 {
     BuildText(textBuilder, previousMatchResult is MatchResult r ? r.StartYear : currentValues.CurrentYear, currentValues.CurrentYear);
 }