Browse Source

Merge pull request #2995 from AvaloniaUI/fix-managed-dialog-enumeration

Fix managed dialog enumeration and volume label on Windows.
pull/2999/head
danwalmsley 7 years ago
committed by GitHub
parent
commit
b58c75fdac
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs

4
src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs

@ -32,9 +32,11 @@ namespace Avalonia.Win32
var allDrives = DriveInfo.GetDrives();
var mountVolInfos = allDrives
.Where(p => p.IsReady)
.Select(p => new MountedVolumeInfo()
{
VolumeLabel = p.VolumeLabel,
VolumeLabel = string.IsNullOrEmpty(p.VolumeLabel.Trim()) ? p.RootDirectory.FullName
: $"{p.VolumeLabel} ({p.Name})",
VolumePath = p.RootDirectory.FullName,
VolumeSizeBytes = (ulong)p.TotalSize
})

Loading…
Cancel
Save