summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Messaging/Configuration/DotNetOpenAuthSection.cs3
-rw-r--r--src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs5
-rw-r--r--src/DotNetOpenAuth.Messaging/Configuration/ReportingElement.cs2
-rw-r--r--src/DotNetOpenAuth.Test/App.config7
4 files changed, 12 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Configuration/DotNetOpenAuthSection.cs b/src/DotNetOpenAuth.Messaging/Configuration/DotNetOpenAuthSection.cs
index af9d45b..87e335c 100644
--- a/src/DotNetOpenAuth.Messaging/Configuration/DotNetOpenAuthSection.cs
+++ b/src/DotNetOpenAuth.Messaging/Configuration/DotNetOpenAuthSection.cs
@@ -41,7 +41,8 @@ namespace DotNetOpenAuth.Configuration {
public static DotNetOpenAuthSection Configuration {
get {
Contract.Ensures(Contract.Result<DotNetOpenAuthSection>() != null);
- return (DotNetOpenAuthSection)ConfigurationManager.GetSection(SectionName) ?? new DotNetOpenAuthSection();
+ var configuration = ConfigurationManager.OpenExeConfiguration(null);
+ return (DotNetOpenAuthSection)configuration.GetSectionGroup(SectionName);
}
}
diff --git a/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs b/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
index 42ab0eb..397c97d 100644
--- a/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
+++ b/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
@@ -68,7 +68,7 @@ namespace DotNetOpenAuth.Configuration {
/// <summary>
/// The name of the &lt;messaging&gt; sub-element.
/// </summary>
- private const string MessagingElementName = DotNetOpenAuthSection.SectionName + "/messaging";
+ private const string MessagingElementName = "messaging";
/// <summary>
/// Gets the configuration section from the .config file.
@@ -76,7 +76,7 @@ namespace DotNetOpenAuth.Configuration {
public static MessagingElement Configuration {
get {
Contract.Ensures(Contract.Result<MessagingElement>() != null);
- return (MessagingElement)ConfigurationManager.GetSection(MessagingElementName) ?? new MessagingElement();
+ return (MessagingElement)DotNetOpenAuthSection.Configuration.Sections[MessagingElementName] ?? new MessagingElement();
}
}
@@ -200,6 +200,7 @@ namespace DotNetOpenAuth.Configuration {
/// <value>
/// The embedded resource retrieval provider.
/// </value>
+ [ConfigurationProperty(WebResourceUrlProviderName)]
internal TypeConfigurationElement<IEmbeddedResourceRetrieval> EmbeddedResourceRetrievalProvider {
get { return (TypeConfigurationElement<IEmbeddedResourceRetrieval>)this[WebResourceUrlProviderName] ?? new TypeConfigurationElement<IEmbeddedResourceRetrieval>(); }
set { this[WebResourceUrlProviderName] = value; }
diff --git a/src/DotNetOpenAuth.Messaging/Configuration/ReportingElement.cs b/src/DotNetOpenAuth.Messaging/Configuration/ReportingElement.cs
index a8eb7d3..4011ba5 100644
--- a/src/DotNetOpenAuth.Messaging/Configuration/ReportingElement.cs
+++ b/src/DotNetOpenAuth.Messaging/Configuration/ReportingElement.cs
@@ -77,7 +77,7 @@ namespace DotNetOpenAuth.Configuration {
public static ReportingElement Configuration {
get {
Contract.Ensures(Contract.Result<ReportingElement>() != null);
- return (ReportingElement)ConfigurationManager.GetSection(ReportingElementName) ?? new ReportingElement();
+ return (ReportingElement)DotNetOpenAuthSection.Configuration.Sections[ReportingElementName] ?? new ReportingElement();
}
}
diff --git a/src/DotNetOpenAuth.Test/App.config b/src/DotNetOpenAuth.Test/App.config
index b3da723..56c3ecd 100644
--- a/src/DotNetOpenAuth.Test/App.config
+++ b/src/DotNetOpenAuth.Test/App.config
@@ -2,7 +2,12 @@
<configuration>
<configSections>
<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
- <section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth"/>
+ <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Messaging">
+ <section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
+ <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
+ <section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Messaging" requirePermission="false" allowLocation="true" />
+ <section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Messaging" requirePermission="false" allowLocation="true" />
+ </sectionGroup>
</configSections>
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),