diff --git a/Utility.Toolkit.Tests/Utility.Toolkit.Tests.csproj b/Utility.Toolkit.Tests/Utility.Toolkit.Tests.csproj index 10a8a03..d22e35a 100644 --- a/Utility.Toolkit.Tests/Utility.Toolkit.Tests.csproj +++ b/Utility.Toolkit.Tests/Utility.Toolkit.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/Utility.Toolkit/ICommandAsync_T.cs b/Utility.Toolkit/ICommandAsync_T.cs new file mode 100644 index 0000000..883b86b --- /dev/null +++ b/Utility.Toolkit/ICommandAsync_T.cs @@ -0,0 +1,28 @@ +using System; + +namespace Utility.Toolkit; + +/// +/// Defines a command with a single generic parameter. +/// +/// The type of parameter used by the command. +public interface ICommandAsync +{ + /// + /// Occurs when changes occur that affect whether the command should execute. + /// + event AsyncEventHandler CanExecuteChanged; + + /// + /// Determines whether the command can execute in its current state with the given parameter. + /// + /// Data used by the command. + /// true if this command can be executed; otherwise, false. + bool CanExecute(T parameter); + + /// + /// Executes the command with the given parameter. + /// + /// Data used by the command. + void Execute(T parameter); +} diff --git a/Utility.Toolkit/Utility.Toolkit.csproj b/Utility.Toolkit/Utility.Toolkit.csproj index 39a58ee..9fded24 100644 --- a/Utility.Toolkit/Utility.Toolkit.csproj +++ b/Utility.Toolkit/Utility.Toolkit.csproj @@ -18,6 +18,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive +