- Fixed MR-84
[castle.git] / MonoRail / Castle.MonoRail.Framework / Filters / PersistFlashFilter.cs
blobde5edb7cae34056a07a60c9687f18ef210062a35
1 // Copyright 2004-2007 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.Filters
17 using Castle.MonoRail.Framework.Attributes;
19 /// <summary>
20 /// Persist entire flash content after an action execution on the controller.
21 /// <seealso cref="PersistFlashAttribute"/>
22 /// </summary>
23 public class PersistFlashFilter : IFilter
25 /// <summary>
26 /// Implementors should perform they filter logic and
27 /// return <c>true</c> if the action should be processed.
28 /// </summary>
29 /// <param name="exec">When this filter is being invoked</param>
30 /// <param name="context">Current context</param>
31 /// <param name="controller">The controller instance</param>
32 /// <returns>
33 /// <c>true</c> if the action
34 /// should be invoked, otherwise <c>false</c>
35 /// </returns>
36 public bool Perform(ExecuteEnum exec, IRailsEngineContext context, IController controller)
38 controller.Flash.Keep();
40 return true;