//-----------------------------------------------------------------------
//
// Copyright (c) Andrew Arnott. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Configuration {
using System.Configuration;
using System.Diagnostics.Contracts;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.Provider;
///
/// The section in the .config file that allows customization of OpenID Provider behaviors.
///
[ContractVerification(true)]
internal class OpenIdProviderElement : ConfigurationElement {
///
/// The name of the <provider> sub-element.
///
private const string ProviderElementName = "provider";
///
/// The name of the security sub-element.
///
private const string SecuritySettingsConfigName = "security";
///
/// Gets the name of the <behaviors> sub-element.
///
private const string BehaviorsElementName = "behaviors";
///
/// The name of the custom store sub-element.
///
private const string StoreConfigName = "store";
///
/// Initializes a new instance of the class.
///
public OpenIdProviderElement() {
}
///
/// Gets or sets the security settings.
///
[ConfigurationProperty(SecuritySettingsConfigName)]
public OpenIdProviderSecuritySettingsElement SecuritySettings {
get { return (OpenIdProviderSecuritySettingsElement)this[SecuritySettingsConfigName] ?? new OpenIdProviderSecuritySettingsElement(); }
set { this[SecuritySettingsConfigName] = value; }
}
///
/// Gets or sets the special behaviors to apply.
///
[ConfigurationProperty(BehaviorsElementName, IsDefaultCollection = false)]
[ConfigurationCollection(typeof(TypeConfigurationCollection))]
public TypeConfigurationCollection Behaviors {
get { return (TypeConfigurationCollection)this[BehaviorsElementName] ?? new TypeConfigurationCollection(); }
set { this[BehaviorsElementName] = value; }
}
///
/// Gets or sets the type to use for storing application state.
///
[ConfigurationProperty(StoreConfigName)]
public TypeConfigurationElement ApplicationStore {
get { return (TypeConfigurationElement)this[StoreConfigName] ?? new TypeConfigurationElement(); }
set { this[StoreConfigName] = value; }
}
}
}