/// <summary> /// Display a toast /// </summary> /// <param name="sender"> The sender </param> /// <param name="e"> Event to recognize devices </param> private static void OnDeviceDisconnected(object sender, DeviceDataEventArgs e) { ThreadPool.SetMaxThreads(GetConnectedDevices().Count, GetConnectedDevices().Count); LoggingManager.DeleteEntry(e.Device.Serial); Console.WriteLine($"The device {e.Device} has disconnected from this PC"); RecController.StopScrRec(e.Device); if (MarkerList.ActiveDeviceData is not null && MarkerList.ActiveDeviceData.Serial.Equals(e.Device.Serial)) { MarkerList.ActiveDeviceData = null; } }
/// <summary> /// Stop the logging process for a specified device /// </summary> /// <param name="device"> The specified device </param> /// <returns> true for success and false for failure </returns> public static bool StopLogging(DeviceData device) { return(LoggingManager.DeleteEntry(device.Serial)); }