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
.Framework
22 public delegate void ControllerHandler(IExecutableAction action
, IEngineContext engineContext
,
23 IController controller
, IControllerContext controllerContext
);
26 /// Represent the core functionality required out of a controller
28 public interface IController
: IDisposable
31 /// Occurs just before the action execution.
33 event ControllerHandler BeforeAction
;
36 /// Occurs just after the action execution.
38 event ControllerHandler AfterAction
;
41 /// Performs the specified action, which means:
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/>
50 /// <param name="engineContext">The engine context.</param>
51 /// <param name="context">The controller context.</param>
52 void Process(IEngineContext engineContext
, IControllerContext context
);
55 /// Invoked by the view engine to perform
56 /// any logic before the view is sent to the client.
58 /// <param name="view"></param>
59 void PreSendView(object view
);
62 /// Invoked by the view engine to perform
63 /// any logic after the view had been sent to the client.
65 /// <param name="view"></param>
66 void PostSendView(object view
);