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