public override void Build(BuildingContext context) { foreach (var segment in Segments.OfType <FileSegmentBuilder>().Reverse()) { segment.Build(context); } }
private void setupArgumentsAndSpread() { _arguments = new Lazy <RouteArgument[]>(() => Segments.OfType <RouteArgument>().ToArray()); _spread = Segments.OfType <Spread>().SingleOrDefault(); if (!HasSpread) { return; } if (!Equals(_spread, Segments.Last())) { throw new ArgumentOutOfRangeException(nameof(Pattern), "The spread parameter can only be the last segment in a route"); } }
public IEnumerable <ImageModuleImport> GetAddedImports() { return(Segments.OfType <ImageModuleImport>()); }
public T GetSegment <T>() where T : IGS1Item { return(Segments.OfType <T>().Select(item => item).SingleOrDefault()); }