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
| public override void Init() { | |
| // Inject properties into the handler before execution | |
| PreRequestHandlerExecute += (sender, e) => | |
| { | |
| var app = sender as HttpApplication; | |
| if (app == null) return; | |
| var handler = app.Context.CurrentHandler; | |
| if (handler == null) return; |
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
| public override void Init() { | |
| // Inject properties into the handler before execution | |
| PreRequestHandlerExecute += (sender, e) => | |
| { | |
| var app = sender as HttpApplication; | |
| if (app == null) return; | |
| var handler = app.Context.CurrentHandler; | |
| if (handler == null) return; |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Web.Mvc; | |
| using System.Web.Routing; | |
| using Spark.Web.Mvc; | |
| namespace Dimecasts.Web | |
| { | |
| using MvcTurbine.ComponentModel; | |
| using MvcTurbine.Web; |
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
| public class CommonServiceRegistration : IServiceRegistration | |
| { | |
| public void Register(IServiceLocator locator) | |
| { | |
| // use the GetUnderlyingContainer to get the 'internal' container the | |
| // application is using | |
| var container = locator.GetUnderlyingContainer<IWindsorContainer>(); | |
| // now you can leverage your container to it's needs | |
| // yes, I know it smells of hack |
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
| /// <summary> | |
| /// Provides the auto-registration of MVC related components (controllers, view engines, filters, etc). | |
| /// </summary> | |
| /// <param name="registrationList"></param> | |
| public virtual void AddRegistrations(AutoRegistrationList registrationList) { | |
| registrationList | |
| .Add(MvcRegistration.RegisterController()) | |
| .Add(MvcRegistration.RegisterViewEngine()) | |
| .Add(MvcRegistration.RegisterFilter<IActionFilter>()) | |
| .Add(MvcRegistration.RegisterFilter<IResultFilter>()) |
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
| <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> | |
| <h2> | |
| Product Details</h2> | |
| <p> | |
| <%= Html.LabelFor(x => x.Id) %>: | |
| <%= Html.InputFor(x => x.Id) %> | |
| <%= Html.DisplayFor(x => x.Id) %></p> | |
| <p> | |
| <%= Html.LabelFor(x => x.Name) %>: | |
| <%= Html.InputFor(x => x.Name) %> |
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
| public class MvcApplication : HttpApplication { | |
| protected void Application_Start() { | |
| var container = new WindsorContainer(); | |
| LocalHtmlConventionRegistry.AddRegistrationsToContainer(container); // must be before HtmlTagsRegistry. | |
| HtmlTagsRegistry.AddRegistrationsToContainer(container); | |
| ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container)); | |
| container.Register(Component.For<IServiceLocator>().Instance(ServiceLocator.Current).LifeStyle.Singleton); | |
| } | |
| } |
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 |
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.Configuration; | |
| using FubuMVC.UI.Tags; | |
| using MvcTurbine.ComponentModel; | |
| public class SupportingServiceRegistration : IServiceRegistration { | |
| public void Register(IServiceLocator locator) { | |
| // Register the common Fubu UI pieces | |
| locator.Register<IElementNamingConvention, DefaultElementNamingConvention>(); |
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 HtmlConventions { | |
| using System; | |
| using FubuMVC.UI; | |
| using FubuMVC.UI.Configuration; | |
| using FubuMVC.UI.Tags; | |
| using HtmlTags; | |
| public class CommonConventions : HtmlConventionRegistry { | |
| public CommonConventions() { | |
| Editors.Always.Attr("class", "test"); |
OlderNewer