-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
|
||
namespace Utility.Toolkit; | ||
|
||
/// <summary> | ||
/// Defines a command with a single generic parameter. | ||
/// </summary> | ||
/// <typeparam name="T">The type of parameter used by the command.</typeparam> | ||
public interface ICommandAsync<in T> | ||
{ | ||
/// <summary> | ||
/// Occurs when changes occur that affect whether the command should execute. | ||
/// </summary> | ||
event AsyncEventHandler CanExecuteChanged; | ||
|
||
/// <summary> | ||
/// Determines whether the command can execute in its current state with the given parameter. | ||
/// </summary> | ||
/// <param name="parameter">Data used by the command.</param> | ||
/// <returns>true if this command can be executed; otherwise, false.</returns> | ||
bool CanExecute(T parameter); | ||
|
||
/// <summary> | ||
/// Executes the command with the given parameter. | ||
/// </summary> | ||
/// <param name="parameter">Data used by the command.</param> | ||
void Execute(T parameter); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters