From 56fa20b86f82851525250dfd3a662484364f7be2 Mon Sep 17 00:00:00 2001 From: holger Date: Fri, 4 Apr 2025 08:58:03 +0200 Subject: [PATCH] Minor changes --- src/DiscoveredDeviceViewModel.cs | 7 +++-- src/MainWindow.axaml | 38 +++++++++++++------------- src/MainWindowViewModel.cs | 46 +++++++++++++------------------- 3 files changed, 42 insertions(+), 49 deletions(-) diff --git a/src/DiscoveredDeviceViewModel.cs b/src/DiscoveredDeviceViewModel.cs index f67c761..179a250 100644 --- a/src/DiscoveredDeviceViewModel.cs +++ b/src/DiscoveredDeviceViewModel.cs @@ -109,14 +109,11 @@ public partial class DiscoveredDeviceViewModel : ObservableObject, IDisposable public async Task GetFurtherInformationAsync() { _ssdpDevice = await _device.GetDeviceInfo().ConfigureAwait(false); - FriendlyName = _ssdpDevice.ModelDescription; + FriendlyName = _ssdpDevice.FriendlyName; Icon = _ssdpDevice.Icons.MinBy(x => x.Height); PresentationUrl = _ssdpDevice.PresentationUrl; ModelNumber = _ssdpDevice.ModelNumber; Version = _ssdpDevice.SerialNumber?.Split(',').Last() ?? new Version().ToString(); - using var client = new HttpClient(); - var response = await client.GetAsync(_ssdpDevice.ModelUrl).ConfigureAwait(false); - ResponseHeader = await response.Content.ReadAsStringAsync(); } private string EvaluateHostName() => Dns.GetHostEntry(IpAddress).HostName; @@ -129,6 +126,8 @@ public partial class DiscoveredDeviceViewModel : ObservableObject, IDisposable private string EvaluateMacAddress() { + if (!ArpLookup.Arp.IsSupported) + return "not supported"; var lookupResult = ArpLookup.Arp.Lookup(IpAddress); return lookupResult is null ? "Unknown" : string.Join(":", lookupResult.GetAddressBytes().Select(b => $"{b:x2}")); } diff --git a/src/MainWindow.axaml b/src/MainWindow.axaml index b8da75d..6e9cfc4 100644 --- a/src/MainWindow.axaml +++ b/src/MainWindow.axaml @@ -1,16 +1,16 @@ + xmlns="https://github.com/avaloniaui" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:sddpViewer="clr-namespace:SddpViewer" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> @@ -18,8 +18,8 @@ @@ -30,7 +30,7 @@