I've just tried:

public void Application_OnStart()
{
    var container = new WindsorContainer(new XmlInterpreter());
    container.AddFacility<MonoRailFacility>("mr.facilty");
 
container.Register(Component.For<IActionSelector>().ImplementedBy<CustomActionSelector>());
}

And that didn't work either. I'm on MR2.1 Beta.

On Jan 12, 8:54 pm, Mauricio Scheffer <[email protected]>
wrote:
> Have you tried adding it directly to Windsor instead of implementing
> IMonoRailContainerEvents?
>
> --
> Mauricio
>
> On Wed, Jan 12, 2011 at 2:48 PM, Colin Ramsay <[email protected]>wrote:
>
>
>
>
>
>
>
> > I'd like to select a different action based on the parameters passed
> > through. I can't actually work out how to replace the default action
> > selector though. I have this class:
>
> > public class CustomActionSelector : DefaultActionSelector
> > {
> >        protected override MethodInfo SelectActionMethod(IController
> > controller, IControllerContext context, string name, ActionType
> > actionType)
> >        {
> >                throw new Exception("WHY WON'T YOU WORK");
> >                return base.SelectActionMethod(controller, context, name,
> > actionType);
> >        }
> > }
>
> > And then I'm trying to hook it up like this:
>
> > public class GlobalApplication : HttpApplication, IContainerAccessor,
> > IMonoRailContainerEvents
> > {
> >        public void Created (IMonoRailContainer container)
> >        {
> >        }
>
> >        public void Initialized (IMonoRailContainer container)
> >        {
> >                container.ActionSelector = new CustomActionSelector();
> >        }
> > }
>
> > But nothing actually happens. I'm using Windsor integration if that
> > makes a difference..
>
> > Thanks,
> > Colin
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Castle Project Users" group.
> > To post to this group, send email to [email protected]
> > .
> > To unsubscribe from this group, send email to
> > [email protected]<castle-project-users%2Bun 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/castle-project-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to