1 namespace Castle
.MonoRail
.Framework
4 using System
.Collections
;
5 using System
.Collections
.Specialized
;
10 /// Represent the core functionality required out of a controller
12 public interface IController
: IDisposable
15 /// Gets the view folder -- (areaname +
16 /// controllername) or just controller name -- that this controller
17 /// will use by default.
19 string ViewFolder { get; }
22 /// Gets a dicitionary of name/<see cref="IResource"/>
24 /// <remarks>It is supposed to be used by MonoRail infrastructure only</remarks>
25 /// <value>The resources.</value>
26 ResourceDictionary Resources { get; }
29 /// Gets a dictionary of name/helper instance
31 /// <value>The helpers.</value>
32 IDictionary Helpers { get; }
35 /// Gets the controller's name.
40 /// Gets the controller's area name.
42 string AreaName { get; }
45 /// Gets or set the layout being used.
47 string LayoutName { get; set; }
50 /// Gets the name of the action being processed.
52 string Action { get; }
55 /// Gets or sets the view which will be rendered by this action.
57 string SelectedViewName { get; set; }
60 /// Gets the property bag, which is used
61 /// to pass variables to the view.
63 IDictionary PropertyBag { get; set; }
66 /// Gets a dictionary of volative items.
67 /// Ideal for showing success and failures messages.
72 /// Gets the request object.
74 IRequest Request { get; }
77 /// Gets the response object.
79 IResponse Response { get; }
82 /// Shortcut to <see cref="IRequest.Params"/>
84 NameValueCollection Params { get; }
87 /// Shortcut to <see cref="IRequest.Form"/>
89 NameValueCollection Form { get; }
92 /// Shortcut to <see cref="IRequest.QueryString"></see>
94 NameValueCollection Query { get; }
97 /// Performs the specified action, which means:
99 /// 1. Define the default view name<br/>
100 /// 2. Run the before filters<br/>
101 /// 3. Select the method related to the action name and invoke it<br/>
102 /// 4. On error, execute the rescues if available<br/>
103 /// 5. Run the after filters<br/>
104 /// 6. Invoke the view engine<br/>
106 /// <param name="action">Action name</param>
107 void Send(string action
);
110 /// Performs the specified action with arguments.
112 /// <param name="action">Action name</param>
113 /// <param name="actionArgs">Action arguments</param>
114 void Send(string action
, IDictionary actionArgs
);
117 /// Invoked by the view engine to perform
118 /// any logic before the view is sent to the client.
120 /// <param name="view"></param>
121 void PreSendView(object view
);
124 /// Invoked by the view engine to perform
125 /// any logic after the view had been sent to the client.
127 /// <param name="view"></param>
128 void PostSendView(object view
);
131 /// Specifies the shared view to be processed and results are written to System.IO.TextWriter.
132 /// (A partial view shared by others views and usually in the root folder
133 /// of the view directory).
135 /// <param name="output"></param>
136 /// <param name="name">The name of the view to process.</param>
137 void InPlaceRenderSharedView(TextWriter output
, string name
);