2024-06-09 21:06:13 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2024-07-17 22:18:20 +02:00
|
|
|
namespace Dashboard.Controls
|
2024-06-09 21:06:13 +02:00
|
|
|
{
|
|
|
|
public abstract class ContainerControl : Control, ICollection<Control>
|
|
|
|
{
|
|
|
|
private readonly List<Control> children = new List<Control>();
|
|
|
|
|
|
|
|
public int Count => children.Count;
|
|
|
|
|
|
|
|
public bool IsReadOnly => false;
|
|
|
|
|
|
|
|
public void Add(Control item)
|
|
|
|
{
|
|
|
|
children.Add(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Clear()
|
|
|
|
{
|
|
|
|
children.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool Contains(Control item)
|
|
|
|
{
|
|
|
|
return children.Contains(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void CopyTo(Control[] array, int arrayIndex)
|
|
|
|
{
|
|
|
|
children.CopyTo(array, arrayIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
public IEnumerator<Control> GetEnumerator()
|
|
|
|
{
|
|
|
|
return children.GetEnumerator();
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool Remove(Control item)
|
|
|
|
{
|
|
|
|
return children.Remove(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
|
|
{
|
|
|
|
return children.GetEnumerator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|