private Func <ElementRequest, int, int, HtmlTag> resolveCreator(AccessorDef accessorDef) { EachPartialTagBuilder initialCreator = _sources.FirstValue(x => x.CreateInitial(accessorDef)); if (initialCreator == null) { throw new FubuException(3001, "Html Conventions have no tag builder for partials for {0}.{1}", accessorDef.ModelType.FullName, accessorDef.Accessor.Name); } EachPartialTagModifier[] modifiers = _modifiers.Select(x => x.CreateModifier(accessorDef)).Where(x => x != null).ToArray(); return((request, index, count) => { HtmlTag tag = initialCreator(request, index, count); modifiers.Each(x => x(request, tag, index, count)); return tag; }); }
public void BuildBy(EachPartialTagBuilder builder) { registerBuilder(builder); }
private void registerBuilder(EachPartialTagBuilder builder) { var lambdaBuilder = new PartialLambdaElementBuilder(_matches, def => builder); _factory.AddBuilder(lambdaBuilder); }