The ChannelAdam Commands Library


An open source, .NET Standard 1.1 library implementation of the Command Pattern - including reversible commands.

Below are the main features of the library. See the linked code for details.

Please contact me if you have any questions.

Getting Started

NuGet Package Installation

To install the ChannelAdam.Commands NuGet package run the following command in the Package Manager Console:

1PM> Install-Package ChannelAdam.Commands


An example of the ReversibleCommandManager, using the ExecuteSetPropertyCommand and UndoPreviousCommand methods:

 1var testObject = new ClassWithProperty
 3    MyProperty = 1
 6var commandManager = new ReversibleCommandManager();
 8commandManager.ExecuteSetPropertyCommand(testObject, p => p.MyProperty, 100);
 9commandManager.ExecuteSetPropertyCommand(testObject, p => p.MyProperty, 200);
12// MyProperty is now back to 100


Command Action

A Command Action has an Execute method with a void return parameter.

Command Function

A Command Function has an Execute method with a specified return parameter.

Reversible Commands

Need to execute some commands and be able to undo them? This Reversible Command implementation is for you!

Use the Reversible Command Manager to manage the stack of commands that can be reversed.

Set Property - Command Implementation

A command implementation for setting a property on an object.

Please leave below any comments, feedback or suggestions, or alternatively contact me on a social network.

comments powered by Disqus