예제 #1
0
 public override void Build(BuildingContext context)
 {
     foreach (var segment in Segments.OfType <FileSegmentBuilder>().Reverse())
     {
         segment.Build(context);
     }
 }
예제 #2
0
        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");
            }
        }
예제 #3
0
 public IEnumerable <ImageModuleImport> GetAddedImports()
 {
     return(Segments.OfType <ImageModuleImport>());
 }
예제 #4
0
 public T GetSegment <T>() where T : IGS1Item
 {
     return(Segments.OfType <T>().Select(item => item).SingleOrDefault());
 }