Files
mRemoteNG/mRemoteV1/Tools/CustomCollections/CollectionUpdatedEventArgs.cs
David Sparer d003e086bb created a class and event type for handling collections that need to raise events for collection changes and child updates
this is for cases where you would like to have INotifyCollectionChanged and INotifyPropertyChanged implemented, but dont need the level of detail that those types provide.
2017-02-13 13:56:58 -07:00

27 lines
643 B
C#

using System;
using System.Collections.Generic;
namespace mRemoteNG.Tools.CustomCollections
{
public class CollectionUpdatedEventArgs<T> : EventArgs
{
public IEnumerable<T> ChangedItems { get; }
public ActionType Action { get; }
public CollectionUpdatedEventArgs(ActionType action, IEnumerable<T> changedItems)
{
if (changedItems == null)
throw new ArgumentNullException(nameof(changedItems));
Action = action;
ChangedItems = changedItems;
}
}
public enum ActionType
{
Added,
Removed,
Updated
}
}