summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2011-07-01 16:49:44 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2011-07-01 16:49:44 -0700
commitb6f7a18b949acb4346754ae47fb07424076a3cd0 (patch)
tree4c23cb2b8174f3288cb0b787cff4c6ac432c6bef /src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs
parentf16525005555b86151b7a1c741aa29550635108a (diff)
downloadDotNetOpenAuth-b6f7a18b949acb4346754ae47fb07424076a3cd0.zip
DotNetOpenAuth-b6f7a18b949acb4346754ae47fb07424076a3cd0.tar.gz
DotNetOpenAuth-b6f7a18b949acb4346754ae47fb07424076a3cd0.tar.bz2
First pass at dividing DotNetOpenAuth features into separate assemblies.
Nothing compiles at this point.
Diffstat (limited to 'src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs')
-rw-r--r--src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs b/src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs
new file mode 100644
index 0000000..9df218e
--- /dev/null
+++ b/src/DotNetOpenAuth.Messaging/Configuration/HostNameElement.cs
@@ -0,0 +1,45 @@
+//-----------------------------------------------------------------------
+// <copyright file="HostNameElement.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Configuration {
+ using System.Configuration;
+ using System.Diagnostics.Contracts;
+
+ /// <summary>
+ /// Represents the name of a single host or a regex pattern for host names.
+ /// </summary>
+ [ContractVerification(true)]
+ internal class HostNameElement : ConfigurationElement {
+ /// <summary>
+ /// Gets the name of the @name attribute.
+ /// </summary>
+ private const string NameConfigName = "name";
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HostNameElement"/> class.
+ /// </summary>
+ internal HostNameElement() {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HostNameElement"/> class.
+ /// </summary>
+ /// <param name="name">The default value of the <see cref="Name"/> property.</param>
+ internal HostNameElement(string name) {
+ this.Name = name;
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the host on the white or black list.
+ /// </summary>
+ [ConfigurationProperty(NameConfigName, IsRequired = true, IsKey = true)]
+ ////[StringValidator(MinLength = 1)]
+ public string Name {
+ get { return (string)this[NameConfigName]; }
+ set { this[NameConfigName] = value; }
+ }
+ }
+}