private void DynamicCommandManagerOnDynamicCommandStatusUpdated(object sender, DynamicCommandStatusUpdatedEventArgs dynamicCommandStatusUpdatedEventArgs) { Logger.Debug("Send dynamic command status ({0}) update of command {1} to AI-{2}", dynamicCommandStatusUpdatedEventArgs.Status, dynamicCommandStatusUpdatedEventArgs.DynamicCommand, Id); var data = new byte[5]; Array.Copy(BitConverter.GetBytes(dynamicCommandStatusUpdatedEventArgs.DynamicCommand), data, 4); data[4] = (byte)dynamicCommandStatusUpdatedEventArgs.Status; SendPackage((byte)FromClientPackage.DynamicCommandStatusUpdate, new WriterCall(data)); }
private void ConnectionManagerOnDynamicCommandStatusUpdated(object sender, DynamicCommandStatusUpdatedEventArgs dynamicCommandStatusUpdatedEventArgs) { Application.Current.Dispatcher.BeginInvoke(new Action(() => { var command = _commands.FirstOrDefault( x => x.DynamicCommand.Id == dynamicCommandStatusUpdatedEventArgs.DynamicCommand); if (command != null) { command.DynamicCommandStatus = dynamicCommandStatusUpdatedEventArgs.Status; } })); }