Show / Hide Table of Contents

Class RemoveFromCollection<T>

An undo command that removes an element from a collection.

Inheritance
Object
SimpleCommand
CollectionCommand<T>
RemoveFromCollection<T>
Implements
IValueCommand
IUndoCommand
Inherited Members
CollectionCommand<T>.Collection
CollectionCommand<T>.Element
CollectionCommand<T>.Value
SimpleCommand.Execute()
SimpleCommand.Undo()
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)

Creates a new remove from collection command.

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 collection.

Methods

OnExecute()

Removes the element from the collection.

Declaration
protected override void OnExecute()
Overrides
SimpleCommand.OnExecute()

OnUndo()

Adds the element to the collection.

Declaration
protected override void OnUndo()
Overrides
SimpleCommand.OnUndo()

Implements

IValueCommand
IUndoCommand

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher