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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
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 |
|
|
|
}) |
|
|
|
|