Created
April 15, 2010 05:46
-
-
Save jglozano/366722 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace FubuMvc.Blades.UI { | |
| using FubuMVC.UI; | |
| using FubuMVC.UI.Tags; | |
| using MvcTurbine; | |
| using MvcTurbine.Blades; | |
| using MvcTurbine.ComponentModel; | |
| public class HtmlConventionBlade : Blade, ISupportAutoRegistration { | |
| public void AddRegistrations(AutoRegistrationList registrationList) { | |
| // Tell the system to scan and auto-register all the HtmlConventionRegistry types | |
| registrationList.Add(Registration.Simple<HtmlConventionRegistry>()); | |
| } | |
| public override void Spin(IRotorContext context) { | |
| IServiceLocator locator = context.ServiceLocator; | |
| // Hydrate the library from the system. | |
| var library = locator.Resolve<TagProfileLibrary>(); | |
| // Get all the registered HTML conventions | |
| var conventions = locator.ResolveServices<HtmlConventionRegistry>(); | |
| // Register each convention | |
| foreach (HtmlConventionRegistry convention in conventions) { | |
| library.ImportRegistry(convention); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment