diff options
Diffstat (limited to 'src/DotNetOpenId/Configuration/WhiteBlackListCollection.cs')
-rw-r--r-- | src/DotNetOpenId/Configuration/WhiteBlackListCollection.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/DotNetOpenId/Configuration/WhiteBlackListCollection.cs b/src/DotNetOpenId/Configuration/WhiteBlackListCollection.cs new file mode 100644 index 0000000..29485d1 --- /dev/null +++ b/src/DotNetOpenId/Configuration/WhiteBlackListCollection.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic;
+using System.Configuration;
+using System.Text.RegularExpressions;
+
+namespace DotNetOpenId.Configuration {
+ internal class WhiteBlackListCollection : ConfigurationElementCollection {
+ public WhiteBlackListCollection() { }
+
+ protected override ConfigurationElement CreateNewElement() {
+ return new WhiteBlackListElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element) {
+ return ((WhiteBlackListElement)element).Name;
+ }
+
+ internal IEnumerable<string> KeysAsStrings {
+ get {
+ foreach (WhiteBlackListElement element in this) {
+ yield return element.Name;
+ }
+ }
+ }
+
+ internal IEnumerable<Regex> KeysAsRegexs {
+ get {
+ foreach (WhiteBlackListElement element in this) {
+ yield return new Regex(element.Name);
+ }
+ }
+ }
+ }
+}
|