/// <summary> /// Sends a command asynchronously. The specified resultCallback will be called when /// the command has executed. /// </summary> public void sendCommandAsync(Command cmd, Command.CommandResultHandler resultCallback) { System.Threading.Thread t = new System.Threading.Thread((System.Threading.ThreadStart) delegate { var response = sendCommand(cmd); resultCallback(cmd, response); }); t.IsBackground = true; t.Start(); }
/// <summary> /// Sends a command asynchronously. The specified resultCallback will be called when /// the command has executed. /// </summary> public async void sendCommandAsync(Command cmd, Command.CommandResultHandler resultCallback) { var response = await sendCommand(cmd); resultCallback(cmd, response); }