mattercontrol/PrintLibrary/SelectedListItems.cs

42 lines
864 B
C#
Raw Normal View History

2014-10-27 10:25:54 -07:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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);
}
}
}
}