More working tests.
[castle.git] / MonoRail / Castle.MonoRail.Framework / IController.cs
blobaabe02fcbcb961a634bfa49f2d61152ea68cd4f5
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.Framework
17 using System;
19 /// <summary>
20 /// Pendent
21 /// </summary>
22 public delegate void ControllerHandler(IExecutableAction action, IEngineContext engineContext,
23 IController controller, IControllerContext controllerContext);
25 /// <summary>
26 /// Represent the core functionality required out of a controller
27 /// </summary>
28 public interface IController : IDisposable
30 /// <summary>
31 /// Occurs just before the action execution.
32 /// </summary>
33 event ControllerHandler BeforeAction;
35 /// <summary>
36 /// Occurs just after the action execution.
37 /// </summary>
38 event ControllerHandler AfterAction;
40 /// <summary>
41 /// Performs the specified action, which means:
42 /// <br/>
43 /// 1. Define the default view name<br/>
44 /// 2. Run the before filters<br/>
45 /// 3. Select the method related to the action name and invoke it<br/>
46 /// 4. On error, execute the rescues if available<br/>
47 /// 5. Run the after filters<br/>
48 /// 6. Invoke the view engine<br/>
49 /// </summary>
50 /// <param name="engineContext">The engine context.</param>
51 /// <param name="context">The controller context.</param>
52 void Process(IEngineContext engineContext, IControllerContext context);
54 /// <summary>
55 /// Invoked by the view engine to perform
56 /// any logic before the view is sent to the client.
57 /// </summary>
58 /// <param name="view"></param>
59 void PreSendView(object view);
61 /// <summary>
62 /// Invoked by the view engine to perform
63 /// any logic after the view had been sent to the client.
64 /// </summary>
65 /// <param name="view"></param>
66 void PostSendView(object view);