summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs')
-rw-r--r--src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs b/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
index 1c46bcf..cec2552 100644
--- a/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
+++ b/src/DotNetOpenAuth.Messaging/Configuration/MessagingElement.cs
@@ -15,7 +15,7 @@ namespace DotNetOpenAuth.Configuration {
/// Represents the <messaging> element in the host's .config file.
/// </summary>
[ContractVerification(true)]
- public class MessagingElement : ConfigurationElement {
+ public class MessagingElement : ConfigurationSection {
/// <summary>
/// The name of the &lt;untrustedWebRequest&gt; sub-element.
/// </summary>
@@ -61,6 +61,21 @@ namespace DotNetOpenAuth.Configuration {
private const string PrivateSecretMaximumAgeConfigName = "privateSecretMaximumAge";
/// <summary>
+ /// The name of the &lt;messaging&gt; sub-element.
+ /// </summary>
+ private const string MessagingElementName = DotNetOpenAuthSection.SectionName + "/messaging";
+
+ /// <summary>
+ /// Gets the configuration section from the .config file.
+ /// </summary>
+ public static MessagingElement Configuration {
+ get {
+ Contract.Ensures(Contract.Result<MessagingElement>() != null);
+ return (MessagingElement)ConfigurationManager.GetSection(MessagingElementName) ?? new MessagingElement();
+ }
+ }
+
+ /// <summary>
/// Gets the actual maximum message lifetime that a program should allow.
/// </summary>
/// <value>The sum of the <see cref="MaximumMessageLifetime"/> and