Refactored the entire .config file supporting classes, and added a .config element...
[dotnetoauth.git] / src / DotNetOpenAuth / Configuration / OpenIdProviderElement.cs
blob5b519079d3a43a2aaf9c6b9c5b90e648f4c652a2
1 //-----------------------------------------------------------------------
2 // <copyright file="OpenIdProviderElement.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
4 // </copyright>
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth.Configuration {
8 using System.Configuration;
9 using DotNetOpenAuth.OpenId.Provider;
11 /// <summary>
12 /// The section in the .config file that allows customization of OpenID Provider behaviors.
13 /// </summary>
14 internal class OpenIdProviderElement : ConfigurationElement {
15 /// <summary>
16 /// The name of the security sub-element.
17 /// </summary>
18 private const string SecuritySettingsConfigName = "security";
20 /// <summary>
21 /// The name of the custom store sub-element.
22 /// </summary>
23 private const string StoreConfigName = "store";
25 /// <summary>
26 /// Initializes a new instance of the <see cref="OpenIdProviderElement"/> class.
27 /// </summary>
28 public OpenIdProviderElement() {
31 /// <summary>
32 /// Gets or sets the security settings.
33 /// </summary>
34 [ConfigurationProperty(SecuritySettingsConfigName)]
35 public ProviderSecuritySettingsElement SecuritySettings {
36 get { return (ProviderSecuritySettingsElement)this[SecuritySettingsConfigName] ?? new ProviderSecuritySettingsElement(); }
37 set { this[SecuritySettingsConfigName] = value; }
40 /// <summary>
41 /// Gets or sets the type to use for storing application state.
42 /// </summary>
43 [ConfigurationProperty(StoreConfigName)]
44 public TypeConfigurationElement<IProviderApplicationStore> ApplicationStore {
45 get { return (TypeConfigurationElement<IProviderApplicationStore>)this[StoreConfigName] ?? new TypeConfigurationElement<IProviderApplicationStore>(); }
46 set { this[StoreConfigName] = value; }