public async Task Send <TCommand>(TCommand command, CancellationToken cancellationToken) where TCommand : ICommand { var handler = _lifetimeScope.Resolve <IHandleCommand <TCommand> >(); await handler.Handle(command, cancellationToken); CommandSent?.Invoke(this, new CommandSentEventArgs(command)); }
protected virtual void OnCommandSent(SerialEventArgs info) { if (CommandSent != null) { Task.Run(() => CommandSent?.Invoke(this, info)); } }
public override void SendCommand(string command) { if (!Port.IsOpen) { return; } Port.Write(command); CommandSent?.Invoke(this, command); Thread.Sleep(Delay); }
public override void SendCommand(string command) { if (!IsConnected) { return; } var stream = Client.GetStream(); var data = Encoding.ASCII.GetBytes(command); stream.Write(data, 0, data.Length); CommandSent?.Invoke(this, command); Thread.Sleep(Delay); }
private void OnCommandSent(string command) { CommandSent?.Invoke(this, new PortCommandSentEventArgs(command)); }
internal static void InvokeCommandSent(CommandSentArgs args) { CommandSent?.Invoke(null, args); }
protected virtual void OnCommandSent(ICommand command) => CommandSent?.Invoke(this, command);
public void RaiseCommand(BaseCommand <TGame, TPlayer, TRoom, TContainer, TThing> cmd) => CommandSent?.Invoke(this, cmd);
/// <summary> /// Raises the <see cref="CommandSent"/> event with passed data. /// </summary> /// <param name="message">NMDC-message that represents the <paramref name="command"/>.</param> /// <param name="command">Sent command.</param> private void OnCommandSent(string message, NmdcCommand command) { CommandSent?.Invoke(this, new NmdcCommandTransferredArgs(DateTime.Now, message, command)); }
private void OnCommandSent(string command) { CommandSent?.Invoke(this, command); }