summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Configuration/HostNameElement.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-01-12 08:40:50 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2012-01-12 08:42:14 -0800
commitaf21cdaf77ca72f54e04f22268b740ce262582fa (patch)
tree9b158e3bff1f56264bccb9e45c8b807816beece6 /src/DotNetOpenAuth.Core/Configuration/HostNameElement.cs
parenta73f2a4830aaa2afcb3f13da2206d9b011dad7fb (diff)
downloadDotNetOpenAuth-af21cdaf77ca72f54e04f22268b740ce262582fa.zip
DotNetOpenAuth-af21cdaf77ca72f54e04f22268b740ce262582fa.tar.gz
DotNetOpenAuth-af21cdaf77ca72f54e04f22268b740ce262582fa.tar.bz2
Renamed assembly DotNetOpenAuth.Messaging(.UI) to DotNetOpenAuth.Core(.UI)
Diffstat (limited to 'src/DotNetOpenAuth.Core/Configuration/HostNameElement.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Configuration/HostNameElement.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Core/Configuration/HostNameElement.cs b/src/DotNetOpenAuth.Core/Configuration/HostNameElement.cs
new file mode 100644
index 0000000..9df218e
--- /dev/null
+++ b/src/DotNetOpenAuth.Core/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; }
+ }
+ }
+}