public async Task <string> SendCommandAsync(string[] arguments, CancellationToken cancel) { try { Running?.Invoke(this, arguments.Where(a => commands.Contains(a.ToLowerInvariant().Trim())).FirstOrDefault() ?? string.Empty); return(await _inner.SendCommandAsync(arguments, cancel)); } finally { StoppedRunning?.Invoke(this, new EventArgs()); } }
public void OnRun(InputAction.CallbackContext context) { switch (context.phase) { case InputActionPhase.Performed: StartedRunning.Invoke(); break; case InputActionPhase.Canceled: StoppedRunning.Invoke(); break; } }