SimpleClassicTheme.Taskbar
SimpleClassicTheme.Taskbar copied to clipboard
Improve collection-based UI
Currently most SCTT components compare UI against data, this is possible to improve, I'd suggest this:
- probably make event/interface/class for item changes
- for static updates/fetches/pulls, you compare those two collections and call events accordingly
I imagine sharing one base class/interface for either event-based updates or pulling.
Examples of old code
Most of SCTT's current code is like this.
List<Item> newItems = new();
foreach (var item in SomeItemSource)
{
newItems.Add(item);
if (!items.Contains(item))
{
/* some init here */
items.Add(item);
}
}
foreach (var item in items)
{
if (!newItems.Contains(item))
{
_ = items.Remove(item);
item.Dispose();
}
}
/* additional processing here */