Surely not, because the default implementation of SelectMethod just
returns null...

On Jan 13, 10:43 am, Tomek Pluskiewicz <[email protected]> wrote:
> Have a look at SelectAction method implementation in 
> Controllerhttps://github.com/castleproject/Castle.MonoRail/blob/master/src/Cast...
>
> First SelectMethod is called (as said, for backward compatibility). I
> suppose it finds a suitable method and then returns, in whch case your
> replacement of IActionSelector is never really used.
>
> Isn't that the source of your problem?
>
> On 13 Sty, 10:49,ColinRamsay <[email protected]> wrote:
>
>
>
>
>
>
>
> > 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<CustomAct 
> > ionSelector>());
>
> > }
>
> > 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,ColinRamsay <[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 
> > > > [email protected]
> > > > .
> > > > To unsubscribe from this group, send email to> 
> > > > >[email protected]<castle-project-users%2Bu
> > > >  [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