/// <summary>
        /// Builds a RegistrySettings class with all the provided details
        /// </summary>
        /// <returns>The registry settings</returns>
        public override RendererSettings BuildSettings()
        {
            var mergedGetters = RendererSettingsDefaults.DefaultValueGetters().MergeLeft(ValueGetters);

            mergedGetters = mergedGetters
                            .OrderBy(x => x.Key, TypeBySubclassAndAssignableImpl.TypeBySubclassAndAssignable())
                            .ToDictionary(item => item.Key, item => item.Value);

            return(new RendererSettings(
                       mergedGetters,
                       TruthyChecks,
                       TemplateLoader,
                       PartialTemplateLoader,
                       MaxRecursionDepth.HasValue ? (MaxRecursionDepth.Value > 0 ? MaxRecursionDepth.Value : uint.MaxValue) : 256,
                       RenderSettings ?? RenderSettings.GetDefaultRenderSettings(),
                       EnumerationConverters,
                       IgnoreCaseOnKeyLookup,
                       Parser ?? new CachedMustacheParser(),
                       new TokenRendererPipeline <Context>(TokenRenderers),
                       DefaultTags ?? new Tags("{{", "}}"),
                       ParserPipeline ?? new ParserPipelineBuilder().Build()));
        }
Esempio n. 2
0
 /// <summary>
 /// Adds the specified type to the section blacklist
 /// </summary>
 /// <param name="type">The type to blacklist for section iteration</param>
 /// <returns>The builder instance for chaining</returns>
 public TBuilder AddSectionBlacklistType(Type type)
 {
     SectionBlacklistTypes = SectionBlacklistTypes ?? RendererSettingsDefaults.DefaultSectionBlacklistTypes();
     SectionBlacklistTypes.Add(type);
     return((TBuilder)this);
 }