Minor style changes
[castle.git] / MonoRail / TestSiteNVelocity / Controllers / TestWizardConditionsController.cs
blob57c97afda70b7dfc6221a8b49c6a184b0451139b
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 TestSiteNVelocity.Controllers
17 using System;
18 using Castle.MonoRail.Framework;
20 [DynamicActionProvider(typeof(WizardActionProvider))]
21 public class TestWizardConditionsController : Controller, IWizardController
23 public void Index()
25 RenderText("Hello!");
28 public void OnWizardStart()
32 public bool OnBeforeStep(String wizardName, String stepName, WizardStepPage step)
34 return true;
37 public void OnAfterStep(String wizardName, String stepName, WizardStepPage step)
42 public WizardStepPage[] GetSteps(IRailsEngineContext context)
44 return new WizardStepPage[] { new Page1() };
47 public class Page1 : WizardStepPage
49 protected override bool IsPreConditionSatisfied(IRailsEngineContext context)
51 bool isOk = Query["id"] == "1";
53 if (!isOk)
55 Redirect("TestWizardConditions", "Index");
58 return isOk;
61 public void InnerAction()
63 Flash["InnerActionInvoked"] = true;
65 RenderText("InnerAction contents");
68 public void InnerAction2()