<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0-preview.7.24405.7" />

ConfigurationPropertyCollection

Represents a collection of configuration-element properties.
using System.Collections; namespace System.Configuration { public class ConfigurationPropertyCollection : ICollection, IEnumerable { private readonly ArrayList _items = new ArrayList(); internal ConfigurationProperty DefaultCollectionProperty => this[""]; public ConfigurationProperty this[string name] { get { for (int i = 0; i < _items.Count; i++) { if (((ConfigurationProperty)_items[i]).Name == name) return (ConfigurationProperty)_items[i]; } return null; } } public int Count => _items.Count; public bool IsSynchronized => false; public object SyncRoot => _items; void ICollection.CopyTo(Array array, int index) { _items.CopyTo(array, index); } public IEnumerator GetEnumerator() { return _items.GetEnumerator(); } public void CopyTo(ConfigurationProperty[] array, int index) { ((ICollection)this).CopyTo((Array)array, index); } public bool Contains(string name) { for (int i = 0; i < _items.Count; i++) { if (((ConfigurationProperty)_items[i]).Name == name) return true; } return false; } public void Add(ConfigurationProperty property) { if (!Contains(property.Name)) _items.Add(property); } public bool Remove(string name) { for (int i = 0; i < _items.Count; i++) { if (!(((ConfigurationProperty)_items[i]).Name != name)) { _items.RemoveAt(i); return true; } } return false; } public void Clear() { _items.Clear(); } } }