NanoByte.Common  2.9.0
NanoByte.Common.Undo.CollectionCommand< T > Class Template Reference

An undo command that adds or removes an element from a collection. More...

Inheritance diagram for NanoByte.Common.Undo.CollectionCommand< T >:
NanoByte.Common.Undo.SimpleCommand NanoByte.Common.Undo.IValueCommand NanoByte.Common.Undo.IUndoCommand NanoByte.Common.Undo.IUndoCommand NanoByte.Common.Undo.AddToCollection< T > NanoByte.Common.Undo.RemoveFromCollection< T >

Protected Member Functions

 CollectionCommand (ICollection< T > collection, T element)
 Creates a new collection command. More...
 
- Protected Member Functions inherited from NanoByte.Common.Undo.SimpleCommand
abstract void OnExecute ()
 Template method to perform the desired action. More...
 
abstract void OnUndo ()
 Template method to undo the changes made by OnExecute. More...
 

Protected Attributes

readonly ICollection< T > Collection
 The collection to be modified. More...
 
readonly T Element
 The element to be added or removed from Collection. More...
 

Properties

object Value [get]
 
- Properties inherited from NanoByte.Common.Undo.IValueCommand
object? Value [get]
 

Additional Inherited Members

- Public Member Functions inherited from NanoByte.Common.Undo.SimpleCommand
void Execute ()
 Performs the desired action. More...
 
virtual void Undo ()
 Undoes the changes made by Execute. More...
 

Detailed Description

An undo command that adds or removes an element from a collection.

Template Parameters
TThe type of elements the collection contains.
Type Constraints
T :notnull 

Constructor & Destructor Documentation

◆ CollectionCommand()

NanoByte.Common.Undo.CollectionCommand< T >.CollectionCommand ( ICollection< T >  collection,
element 
)
inlineprotected

Creates a new collection command.

Parameters
collectionThe collection to be modified.
elementThe element to be added or removed from collection .

Member Data Documentation

◆ Collection

readonly ICollection<T> NanoByte.Common.Undo.CollectionCommand< T >.Collection
protected

The collection to be modified.

◆ Element

readonly T NanoByte.Common.Undo.CollectionCommand< T >.Element
protected

The element to be added or removed from Collection.


The documentation for this class was generated from the following file: