public void Activate(IEnumerable <IPackageInfo> packages, IPackageLog log)
        {
            var library = new TagProfileLibrary();

            _conventions.Each(library.ImportRegistry);

            library.ImportRegistry(new DefaultHtmlConventions());
            library.Seal();

            _container.Register(typeof(TagProfileLibrary), ObjectDef.ForValue(library));
        }
Example #2
0
        private void registerHtmlConventions(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>();
        }