示例#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());
 }