Table of Contents

Class RemoveFromCollection<T>

Namespace
NanoByte.Common.Undo
Assembly
NanoByte.Common.dll

An undo command that removes an element from a collection.

public sealed class RemoveFromCollection<T> : CollectionCommand<T>, IValueCommand, IUndoCommand where T : notnull

Type Parameters

T

The type of elements the collection contains.

Inheritance
RemoveFromCollection<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

collection ICollection<T>

The collection to be modified.

element T

The 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()