Exemplo n.º 1
0
        public void Configure(BehaviorGraph graph)
        {
            var library = new TagProfileLibrary();

            graph.Services.FindAllValues<HtmlConventionRegistry>()
                .Each(library.ImportRegistry);

            library.ImportRegistry(new DefaultHtmlConventions());

            library.Seal();

            graph.Services.ClearAll<HtmlConventionRegistry>();
            graph.Services.ReplaceService(library);
            graph.Services.SetServiceIfNone(typeof(ITagGenerator<>), typeof(TagGenerator<>));
            graph.Services.SetServiceIfNone<IElementNamingConvention, DefaultElementNamingConvention>();
            graph.Services.SetServiceIfNone<IFieldAccessService, FieldAccessService>();

            if (graph.IsDiagnosticsEnabled())
            {
                graph.Services.SetServiceIfNone<IFieldAccessRightsExecutor, RecordingFieldAccessRightsExecutor>();
            }
            else
            {
                graph.Services.SetServiceIfNone<IFieldAccessRightsExecutor, FieldAccessRightsExecutor>();
            }
        }
 public void Configure(BehaviorGraph graph)
 {
     var tagProfileLibrary = new TagProfileLibrary();
     graph.Services.FindAllValues<HtmlConventionRegistry>().Each(tagProfileLibrary.ImportRegistry);
     tagProfileLibrary.ImportRegistry(new DefaultHtmlConventions());
     tagProfileLibrary.Seal();
     graph.Services.ClearAll<HtmlConventionRegistry>();
     graph.Services.ReplaceService(tagProfileLibrary);
     graph.Services.SetServiceIfNone<IElementNamingConvention, DefaultElementNamingConvention>();
     graph.Services.SetServiceIfNone<ILabelAndFieldLayout, DefinitionListLabelAndField>();
 }
Exemplo n.º 3
0
        public void Configure(BehaviorGraph graph)
        {
            var library = new TagProfileLibrary();

            graph.Services.FindAllValues<HtmlConventionRegistry>()
                .Each(library.ImportRegistry);

            library.ImportRegistry(new DefaultHtmlConventions());

            library.Seal();

            graph.Services.ClearAll<HtmlConventionRegistry>();

            graph.Services.ReplaceService(library);
            graph.Services.SetServiceIfNone(typeof(ITagGenerator<>), typeof(TagGenerator<>));
            graph.Services.SetServiceIfNone<IElementNamingConvention, DefaultElementNamingConvention>();
        }