1
//-----------------------------------------------------------------------
2 // <copyright file="AssociationTypeCollection.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth
.Configuration
{
9 using System
.Collections
.Generic
;
10 using System
.Configuration
;
15 /// Describes a collection of association type sub-elements in a .config file.
17 internal class AssociationTypeCollection
: ConfigurationElementCollection
, IEnumerable
<AssociationTypeElement
> {
19 /// Initializes a new instance of the <see cref="AssociationTypeCollection"/> class.
21 public AssociationTypeCollection() {
24 #region IEnumerable<AssociationTypeElement> Members
27 /// Returns an enumerator that iterates through the collection.
30 /// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
32 public new IEnumerator
<AssociationTypeElement
> GetEnumerator() {
33 return this.Cast
<AssociationTypeElement
>().GetEnumerator();
39 /// When overridden in a derived class, creates a new <see cref="T:System.Configuration.ConfigurationElement"/>.
42 /// A new <see cref="T:System.Configuration.ConfigurationElement"/>.
44 protected override ConfigurationElement
CreateNewElement() {
45 return new AssociationTypeElement();
49 /// Gets the element key for a specified configuration element when overridden in a derived class.
51 /// <param name="element">The <see cref="T:System.Configuration.ConfigurationElement"/> to return the key for.</param>
53 /// An <see cref="T:System.Object"/> that acts as the key for the specified <see cref="T:System.Configuration.ConfigurationElement"/>.
55 protected override object GetElementKey(ConfigurationElement element
) {
56 return ((AssociationTypeElement
)element
).AssociationType
;