WrappedCollection.cs 1.2 KB

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. namespace System.Windows.Forms
  3. {
  4. public abstract class WrappedCollection : IList
  5. {
  6. protected abstract IList InnerList { get; }
  7. public int Count => InnerList.Count;
  8. void IList.Clear() => InnerList.Clear();
  9. bool IList.Contains(object value) => InnerList.Contains(value);
  10. int IList.IndexOf(object value) => InnerList.IndexOf(value);
  11. IEnumerator IEnumerable.GetEnumerator() => InnerList.GetEnumerator();
  12. bool IList.IsReadOnly => InnerList.IsReadOnly;
  13. bool IList.IsFixedSize => InnerList.IsFixedSize;
  14. object ICollection.SyncRoot => InnerList.SyncRoot;
  15. bool ICollection.IsSynchronized => InnerList.IsSynchronized;
  16. object IList.this[int index] { get => InnerList[index]; set => InnerList[index] = value; }
  17. void ICollection.CopyTo(Array array, int index) => InnerList.CopyTo(array, index);
  18. int IList.Add(object value) => InnerList.Add(value);
  19. void IList.Insert(int index, object value) => InnerList.Insert(index, value);
  20. void IList.Remove(object value) => InnerList.Remove(value);
  21. void IList.RemoveAt(int index) => InnerList.RemoveAt(index);
  22. }
  23. }