summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/Configuration/ProviderSection.cs
blob: cfd6052ff4e48d59bf891abe6cc958798cb4d420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Configuration;
using DotNetOpenId.Provider;
using IProviderAssociationStore = DotNetOpenId.IAssociationStore<DotNetOpenId.AssociationRelyingPartyType>;

namespace DotNetOpenId.Configuration {
	internal class ProviderSection : ConfigurationSection {
		internal static ProviderSection Configuration {
			get { return (ProviderSection)ConfigurationManager.GetSection("dotNetOpenId/provider") ?? new ProviderSection(); }
		}

		public ProviderSection() { }

		const string securitySettingsConfigName = "security";
		[ConfigurationProperty(securitySettingsConfigName)]
		public ProviderSecuritySettingsElement SecuritySettings {
			get { return (ProviderSecuritySettingsElement)this[securitySettingsConfigName] ?? new ProviderSecuritySettingsElement(); }
			set { this[securitySettingsConfigName] = value; }
		}

		const string storeConfigName = "store";
		[ConfigurationProperty(storeConfigName)]
		public StoreConfigurationElement<IProviderAssociationStore> Store {
			get { return (StoreConfigurationElement<IProviderAssociationStore>)this[storeConfigName] ?? new StoreConfigurationElement<IProviderAssociationStore>(); }
			set { this[storeConfigName] = value; }
		}
	}
}