implement ActionCommandItem - command item that directly executes an action (not a Command)... not sure why

This commit is contained in:
Michael Becker 2021-04-29 22:34:48 -04:00
parent 014a9b99c4
commit 2ed59233b3
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -24,6 +24,28 @@ namespace MBS.Framework
} }
} }
} }
public class ActionCommandItem : CommandItem
{
public string ID { get; }
public string Title { get; }
public event EventHandler Executed;
public void Execute()
{
Executed?.Invoke(this, EventArgs.Empty);
}
public ActionCommandItem(string id, string title, EventHandler execute = null)
{
ID = id;
Title = title;
if (execute != null)
{
Executed += execute;
}
}
}
public class CommandReferenceCommandItem : CommandItem public class CommandReferenceCommandItem : CommandItem
{ {
private string mvarCommandID = String.Empty; private string mvarCommandID = String.Empty;