1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
;
24 /// Initializes a new instance of the <see cref="MethodActionExecutor"/> class.
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; }