1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
19 using Castle
.MicroKernel
;
20 using Castle
.MonoRail
.Framework
;
23 /// Default implementation of <see cref="IWizardPageFactory"/>
24 /// which requests components from the <see cref="IKernel"/>
26 public class DefaultWizardPageFactory
: IWizardPageFactory
28 private readonly IKernel kernel
;
31 /// Initializes a new instance of the <see cref="DefaultWizardPageFactory"/> class.
33 /// <param name="kernel">The kernel.</param>
34 public DefaultWizardPageFactory(IKernel kernel
)
40 /// Requests a <see cref="WizardStepPage"/> by
41 /// the key the component was registered on the
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
];
52 /// Requests a <see cref="WizardStepPage"/> by
53 /// the key the component was registered on the
56 /// <param name="stepPageType"></param>
57 /// <returns>The step page instance</returns>
58 public WizardStepPage
CreatePage(Type stepPageType
)
60 return (WizardStepPage
) kernel
[stepPageType
];