Changed to use Authenticate asp.net event instead of Authorize
[castle.git] / MonoRail / TestSiteWindsor / Controllers / TestWizardController.cs
blobc2c050fb8f774c71e9ab2d2f17e52482abf3b823
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 TestSiteWindsor.Controllers
17 using System;
19 using Castle.MicroKernel;
20 using Castle.MonoRail.Framework;
23 [DynamicActionProvider( typeof(WizardActionProvider) ), Serializable]
24 public class TestWizardController : Controller, IWizardController
26 private readonly IKernel kernel;
28 public TestWizardController(IKernel kernel)
30 this.kernel = kernel;
33 public void Index()
35 RenderText("Hello!");
38 public void OnWizardStart()
42 public bool OnBeforeStep(String wizardName, String stepName, WizardStepPage step)
44 return true;
47 public void OnAfterStep(String wizardName, String stepName, WizardStepPage step)
51 public WizardStepPage[] GetSteps(IRailsEngineContext context)
53 return new WizardStepPage[]
55 (WizardStepPage) kernel[typeof(Page1)],
56 (WizardStepPage) kernel[typeof(Page2)],
57 (WizardStepPage) kernel[typeof(Page3)],
58 (WizardStepPage) kernel[typeof(Page4)],
63 public class Page1 : WizardStepPage
65 public void InnerAction()
67 Flash["InnerActionInvoked"] = true;
69 RenderText("InnerAction contents");
72 public void InnerAction2()
77 public class Page2 : WizardStepPage
79 protected override void RenderWizardView()
81 RenderText("A content rendered using RenderText");
85 public class Page3 : WizardStepPage
87 protected override void RenderWizardView()
89 RenderView("page3");
93 public class Page4 : WizardStepPage
95 public void InnerAction()
97 Flash["InnerActionInvoked"] = true;
99 DoNavigate();