TabControl.TabPageCollection.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections;
  2. namespace System.Windows.Forms
  3. {
  4. public partial class TabControl
  5. {
  6. public class TabPageCollection : WrappedCollection
  7. {
  8. protected internal ControlCollection items;
  9. protected override IList InnerList => items;
  10. public TabPage this[int index]
  11. {
  12. get => items[index] as TabPage;
  13. }
  14. public int Add(TabPage obj) => items.Add(obj);
  15. public void AddRange(TabPage[] objects)
  16. {
  17. foreach (TabPage obj in objects)
  18. Add(obj);
  19. }
  20. public void Insert(int index, TabPage obj) => items.Insert(index, obj);
  21. public void Remove(TabPage obj) => items.Remove(obj);
  22. public void RemoveAt(int index) => items.RemoveAt(index);
  23. public void Clear() => items.Clear();
  24. public int IndexOf(TabPage obj) => items.IndexOf(obj);
  25. public bool Contains(TabPage obj) => items.Contains(obj);
  26. internal TabPageCollection(ControlCollection items)
  27. {
  28. this.items = items;
  29. }
  30. }
  31. }
  32. }