summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs60
1 files changed, 4 insertions, 56 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs b/src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs
index 6ba7e23..858d27b 100644
--- a/src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs
+++ b/src/DotNetOpenAuth.OAuth2/Configuration/OAuth2Element.cs
@@ -11,68 +11,16 @@ namespace DotNetOpenAuth.Configuration {
/// <summary>
/// Represents the &lt;oauth&gt; element in the host's .config file.
/// </summary>
- internal class OAuth2Element : ConfigurationSection {
+ internal class OAuth2SectionGroup : ConfigurationSectionGroup {
/// <summary>
/// The name of the oauth section.
/// </summary>
- private const string SectionName = DotNetOpenAuthSection.SectionName + "/oauth2";
+ internal const string SectionName = DotNetOpenAuthSection.SectionName + "/oauth2";
/// <summary>
- /// The name of the &lt;client&gt; sub-element.
+ /// Initializes a new instance of the <see cref="OAuth2SectionGroup"/> class.
/// </summary>
- private const string ClientElementName = "client";
-
- /// <summary>
- /// The name of the &lt;authorizationServer&gt; sub-element.
- /// </summary>
- private const string AuthorizationServerElementName = "authorizationServer";
-
- /// <summary>
- /// The name of the &lt;resourceServer&gt; sub-element.
- /// </summary>
- private const string ResourceServerElementName = "resourceServer";
-
- /// <summary>
- /// Initializes a new instance of the <see cref="OAuth2Element"/> class.
- /// </summary>
- internal OAuth2Element() {
- }
-
- /// <summary>
- /// Gets the configuration section from the .config file.
- /// </summary>
- public static OAuth2Element Configuration {
- get {
- Contract.Ensures(Contract.Result<OAuth2Element>() != null);
- return (OAuth2Element)ConfigurationManager.GetSection(SectionName) ?? new OAuth2Element();
- }
- }
-
- /// <summary>
- /// Gets or sets the configuration specific for Clients.
- /// </summary>
- [ConfigurationProperty(ClientElementName)]
- internal OAuth2ClientElement Client {
- get { return (OAuth2ClientElement)this[ClientElementName] ?? new OAuth2ClientElement(); }
- set { this[ClientElementName] = value; }
- }
-
- /// <summary>
- /// Gets or sets the configuration specific for Authorization Servers.
- /// </summary>
- [ConfigurationProperty(AuthorizationServerElementName)]
- internal OAuth2AuthorizationServerElement AuthorizationServer {
- get { return (OAuth2AuthorizationServerElement)this[AuthorizationServerElementName] ?? new OAuth2AuthorizationServerElement(); }
- set { this[AuthorizationServerElementName] = value; }
- }
-
- /// <summary>
- /// Gets or sets the configuration specific for Resource Servers.
- /// </summary>
- [ConfigurationProperty(ResourceServerElementName)]
- internal OAuth2ResourceServerElement ResourceServer {
- get { return (OAuth2ResourceServerElement)this[ResourceServerElementName] ?? new OAuth2ResourceServerElement(); }
- set { this[ResourceServerElementName] = value; }
+ internal OAuth2SectionGroup() {
}
}
}