Skip to content

Instantly share code, notes, and snippets.

@chrisnas
Created November 8, 2020 16:33
Show Gist options
  • Select an option

  • Save chrisnas/3f566611832ecb8c77907dc158cde729 to your computer and use it in GitHub Desktop.

Select an option

Save chrisnas/3f566611832ecb8c77907dc158cde729 to your computer and use it in GitHub Desktop.
public class TaskStateCommand : ExtensionCommandBase
{
[Argument(Help = "The Task instance address.")]
public string Address { get; set; }
public override void Invoke()
{
if (string.IsNullOrEmpty(Address) && !Value.HasValue)
{
WriteLine("Missing Task reference address or state value..." + Environment.NewLine);
return;
}
...
if (!TryParseAddress(Address, out var address))
{
WriteLine("Numeric value expected: either a task address or -v <state value>..." + Environment.NewLine);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment