Class RemoveFromCollection<T>
An undo command that removes an element from a collection.
public sealed class RemoveFromCollection<T> : CollectionCommand<T>, IValueCommand, IUndoCommand where T : notnull
Type Parameters
TThe type of elements the collection contains.
- Inheritance
-
objectRemoveFromCollection<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
RemoveFromCollection(ICollection<T>, T)
An undo command that removes an element from a collection.
public RemoveFromCollection(ICollection<T> collection, T element)
Parameters
collectionICollection<T>The collection to be modified.
elementTThe element to be removed from
collection.
Methods
OnExecute()
Removes the element from the collection.
protected override void OnExecute()
OnUndo()
Adds the element to the collection.
protected override void OnUndo()