Skip to content

Instantly share code, notes, and snippets.

@jglozano
Created April 15, 2010 05:46
Show Gist options
  • Select an option

  • Save jglozano/366722 to your computer and use it in GitHub Desktop.

Select an option

Save jglozano/366722 to your computer and use it in GitHub Desktop.
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