mattercontrol/MatterControlLib/Utilities/SelectedListItems.cs
Lars Brubaker bed90234e7 Made MatterControl run as a .net standard app
Moving matter control to a lib and creating a new exe to run it
2018-09-06 16:09:58 -07:00

40 lines
No EOL
602 B
C#

using System;
using System.Collections.Generic;
namespace MatterHackers.MatterControl
{
public class SelectedListItems<T> : List<T>
{
public event EventHandler OnAdd;
public event EventHandler OnRemove;
new public void Add(T item)
{
base.Add(item);
if (null != OnAdd)
{
OnAdd(this, null);
}
}
new public void Remove(T item)
{
base.Remove(item);
if (null != OnRemove)
{
OnRemove(this, null);
}
}
// Also fire OnRemove on Clear
new public void Clear()
{
base.Clear();
if (null != OnRemove)
{
OnRemove(this, null);
}
}
}
}