Changed to use Authenticate asp.net event instead of Authorize
[castle.git] / MonoRail / Castle.MonoRail.WindsorExtension / DefaultWizardPageFactory.cs
blob614abea6b375e8a3ef0c3aa754968b0028449439
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.WindsorExtension
17 using System;
19 using Castle.MicroKernel;
20 using Castle.MonoRail.Framework;
22 /// <summary>
23 /// Default implementation of <see cref="IWizardPageFactory"/>
24 /// which requests components from the <see cref="IKernel"/>
25 /// </summary>
26 public class DefaultWizardPageFactory : IWizardPageFactory
28 private readonly IKernel kernel;
30 /// <summary>
31 /// Initializes a new instance of the <see cref="DefaultWizardPageFactory"/> class.
32 /// </summary>
33 /// <param name="kernel">The kernel.</param>
34 public DefaultWizardPageFactory(IKernel kernel)
36 this.kernel = kernel;
39 /// <summary>
40 /// Requests a <see cref="WizardStepPage"/> by
41 /// the key the component was registered on the
42 /// controller
43 /// </summary>
44 /// <param name="key">The key used to register the component</param>
45 /// <returns>The step page instance</returns>
46 public WizardStepPage CreatePage(String key)
48 return (WizardStepPage) kernel[key];
51 /// <summary>
52 /// Requests a <see cref="WizardStepPage"/> by
53 /// the key the component was registered on the
54 /// controller
55 /// </summary>
56 /// <param name="stepPageType"></param>
57 /// <returns>The step page instance</returns>
58 public WizardStepPage CreatePage(Type stepPageType)
60 return (WizardStepPage) kernel[stepPageType];