Added an ObservableList class which is like the ObservableCollection, but allows indexed access

git-svn-id: file:///srv/devel/repo-conversion/nusu@220 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2011-08-24 11:33:22 +00:00
parent d3e055a37c
commit a4000c106a
8 changed files with 561 additions and 8 deletions

View file

@ -86,7 +86,7 @@ namespace Nuclex.Support.Collections {
protected virtual void OnCollectionChanged(
NotifyCollectionChangedAction action, TItem item, int index
) {
if (CollectionChanged != null) {
if(CollectionChanged != null) {
CollectionChanged(
this, new NotifyCollectionChangedEventArgs(action, item, index)
);
@ -141,30 +141,29 @@ namespace Nuclex.Support.Collections {
/// <summary>Fires the 'ItemAdded' event</summary>
/// <param name="item">Item that has been added to the collection</param>
protected virtual void OnAdded(TItem item) {
if (ItemAdded != null)
if(ItemAdded != null)
ItemAdded(this, new ItemEventArgs<TItem>(item));
}
/// <summary>Fires the 'ItemRemoved' event</summary>
/// <param name="item">Item that has been removed from the collection</param>
protected virtual void OnRemoved(TItem item) {
if (ItemRemoved != null)
if(ItemRemoved != null)
ItemRemoved(this, new ItemEventArgs<TItem>(item));
}
/// <summary>Fires the 'Clearing' event</summary>
protected virtual void OnClearing() {
if (Clearing != null)
if(Clearing != null)
Clearing(this, EventArgs.Empty);
}
/// <summary>Fires the 'Cleared' event</summary>
protected virtual void OnCleared() {
if (Cleared != null)
if(Cleared != null)
Cleared(this, EventArgs.Empty);
}
}
} // namespace Nuclex.Support.Collections