public static void AddUSBHidLog(FS2LogItem value) { if (LogsViewModel.Current != null) { LogsViewModel.Current.AddLog(value); } }
public void AddLog(FS2LogItem value) { Dispatcher.Invoke(new Action(() => { HidLogs.Insert(0, value); if (HidLogs.Count > 1000) HidLogs.Remove(HidLogs.Last()); })); }
public bool Send(List<byte> bytes, string name, string deviceName, int attemptNo) { //Trace.WriteLine(DateTime.Now.TimeOfDay.ToString() + " - Send Name = " + name + " - " + attemptNo); var fs2LogItem = new FS2LogItem() { DateTime = DateTime.Now, Name = name, DeviceName = deviceName, AttemptNo = attemptNo }; LogService.AddUSBHidLog(fs2LogItem); if (IsDisposed) return false; UsbHidPort.SpecifiedDevice.SendData(bytes.ToArray()); return true; }