Class AddToCollection<T>
An undo command that adds an element to a collection.
Inherited Members
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.dll
Syntax
public sealed class AddToCollection<T> : CollectionCommand<T>, IValueCommand, IUndoCommand
Type Parameters
Name | Description |
---|---|
T | The type of elements the collection contains. |
Constructors
AddToCollection(ICollection<T>, T)
An undo command that adds an element to a collection.
Declaration
public AddToCollection(ICollection<T> collection, T element)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection to be modified. |
T | element | The element to be added to |
Methods
OnExecute()
Adds the element to the collection.
Declaration
protected override void OnExecute()
Overrides
OnUndo()
Removes the element from the collection.
Declaration
protected override void OnUndo()