Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / MonoRail2 / Castle.MonoRail / MethodActionExecutor.cs
blobd391787d361b1d405124f2b15c69f7da954f2e3a
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail
17 using System.Reflection;
19 public class MethodActionExecutor : ActionExecutor
21 private readonly MethodInfo actionMethod;
23 /// <summary>
24 /// Initializes a new instance of the <see cref="MethodActionExecutor"/> class.
25 /// </summary>
26 /// <param name="actionMethod">The action method.</param>
27 public MethodActionExecutor(MethodInfo actionMethod) : base(actionMethod.Name)
29 this.actionMethod = actionMethod;
32 public override void Execute(object controller)
34 actionMethod.Invoke(controller, null);
37 public override ActionType ActionType
39 get { return ActionType.Method; }