Move MatterControl source code into a subdirectory
This commit is contained in:
parent
2c6e34243a
commit
70af2d9ae8
2007 changed files with 13 additions and 8 deletions
40
original/MatterControlLib/Utilities/SelectedListItems.cs
Normal file
40
original/MatterControlLib/Utilities/SelectedListItems.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue