private void OnDeviceLocatorDeviceUnavailable(object sender, DeviceUnavailableEventArgs e) { var originalHeaders = e.DiscoveredDevice.ResponseHeaders; var headerDict = originalHeaders == null ? new Dictionary <string, KeyValuePair <string, IEnumerable <string> > >() : originalHeaders.ToDictionary(i => i.Key, StringComparer.OrdinalIgnoreCase); var headers = headerDict.ToDictionary(i => i.Key, i => i.Value.Value.FirstOrDefault(), StringComparer.OrdinalIgnoreCase); var args = new GenericEventArgs <UpnpDeviceInfo>( new UpnpDeviceInfo { Location = e.DiscoveredDevice.DescriptionLocation, Headers = headers }); DeviceLeft?.Invoke(this, args); }
static void _BroadcastListener_DeviceUnavailable(object sender, DeviceUnavailableEventArgs e) { Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("ByeBye Broadcast: " + e.DiscoveredDevice.Usn + " @ " + e.DiscoveredDevice.DescriptionLocation); Console.ForegroundColor = ConsoleColor.Gray; }
public void DeviceUnavailableEventArgs_Constructor_ThrowsOnNullDevice() { var args = new DeviceUnavailableEventArgs(null, false); }
private void DeviceLocator_DeviceUnavailable(object sender, DeviceUnavailableEventArgs e) { Debug.WriteLine("UNAVAIL DEVICE EVENT --> " + e.DiscoveredDevice.NotificationType + ": " + e.DiscoveredDevice.DescriptionLocation); }