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