|
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace PasswordSafe.Classes
{
public class NotifyList:BindingList<object>
{
private bool modified;
public bool Modified
{
get { return modified; }
set
{
modified = value;
if (modified) OnModified();
}
}
private void OnModified()
{
if (ModifyChanged != null) ModifyChanged(this, EventArgs.Empty);
}
public event EventHandler ModifyChanged;
protected override void OnListChanged(ListChangedEventArgs e)
{
base.OnListChanged(e);
switch (e.ListChangedType)
{
case ListChangedType.ItemAdded:
PrepareItem(this[e.NewIndex]);
break;
}
Modified = true;
}
private void PrepareItem(object item)
{
NotifyItemBase nib = item as NotifyItemBase;
if (nib != null) nib.List = this;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.