mattercontrol/Utilities/SelectedListItems.cs
Lars Brubaker 038b40ada6 New library code to support provider pluggins for things like
cloud library
drop box
file system folders
etc...
2015-06-10 17:53:17 -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);
}
}
}
}