﻿// Decompiled with JetBrains decompiler
// Type: System.Configuration.SchemeSettingElementCollection
// Assembly: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 5ABD58FD-DF31-44FD-A492-63F2B47CC9AF
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll

namespace System.Configuration
{
  /// <summary>
  /// Represents a collection of <see cref="T:System.Configuration.SchemeSettingElement"/> objects.
  /// </summary>
  [ConfigurationCollection(typeof (SchemeSettingElement), AddItemName = "add", ClearItemsName = "clear", CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap, RemoveItemName = "remove")]
  public sealed class SchemeSettingElementCollection : ConfigurationElementCollection
  {
    internal const string AddItemName = "add";
    internal const string ClearItemsName = "clear";
    internal const string RemoveItemName = "remove";

    /// <summary>
    /// Gets the default collection type of <see cref="T:System.Configuration.SchemeSettingElementCollection"/>.
    /// </summary>
    /// 
    /// <returns>
    /// The default collection type of <see cref="T:System.Configuration.SchemeSettingElementCollection"/>.
    /// </returns>
    public override ConfigurationElementCollectionType CollectionType
    {
      get
      {
        return ConfigurationElementCollectionType.AddRemoveClearMap;
      }
    }

    /// <summary>
    /// Gets an item at the specified index in the <see cref="T:System.Configuration.SchemeSettingElementCollection"/> collection.
    /// </summary>
    /// 
    /// <returns>
    /// The specified <see cref="T:System.Configuration.SchemeSettingElement"/>.
    /// </returns>
    /// <param name="index">The index of the <see cref="T:System.Configuration.SchemeSettingElement"/> to return.</param><exception cref="T:System.Configuration.ConfigurationErrorsException">The <paramref name="index"/> parameter is less than zero.-or- The item specified by the parameter is null or has been removed.</exception>
    public SchemeSettingElement this[int index]
    {
      get
      {
        return (SchemeSettingElement) this.BaseGet(index);
      }
    }

    /// <summary>
    /// Gets an item from the <see cref="T:System.Configuration.SchemeSettingElementCollection"/> collection.
    /// </summary>
    /// 
    /// <returns>
    /// A <see cref="T:System.Configuration.SchemeSettingElement"/> object contained in the collection.
    /// </returns>
    /// <param name="name">A string reference to the <see cref="T:System.Configuration.SchemeSettingElement"/> object within the collection.</param>
    public SchemeSettingElement this[string name]
    {
      get
      {
        return (SchemeSettingElement) this.BaseGet((object) name);
      }
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.Configuration.SchemeSettingElementCollection"/> class.
    /// </summary>
    public SchemeSettingElementCollection()
    {
      this.AddElementName = "add";
      this.ClearElementName = "clear";
      this.RemoveElementName = "remove";
    }

    /// <summary>
    /// The index of the specified <see cref="T:System.Configuration.SchemeSettingElement"/>.
    /// </summary>
    /// 
    /// <returns>
    /// The index of the specified <see cref="T:System.Configuration.SchemeSettingElement"/>; otherwise, -1.
    /// </returns>
    /// <param name="element">The <see cref="T:System.Configuration.SchemeSettingElement"/> for the specified index location.</param>
    public int IndexOf(SchemeSettingElement element)
    {
      return this.BaseIndexOf((ConfigurationElement) element);
    }

    protected override ConfigurationElement CreateNewElement()
    {
      return (ConfigurationElement) new SchemeSettingElement();
    }

    protected override object GetElementKey(ConfigurationElement element)
    {
      return (object) ((SchemeSettingElement) element).Name;
    }
  }
}
