소스 검색

fix windows mounted listener.

Dan Walmsley 6 년 전
부모
커밋
734b9f39b3
1개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. 4 5
      src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs

+ 4 - 5
src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs

@@ -10,8 +10,7 @@ namespace Avalonia.Win32
 {
     internal class WindowsMountedVolumeInfoListener : IDisposable
     {
-        private readonly CompositeDisposable _disposables;
-        private readonly ObservableCollection<MountedVolumeInfo> _targetObs = new ObservableCollection<MountedVolumeInfo>();
+        private readonly CompositeDisposable _disposables;        
         private bool _beenDisposed = false;
         private ObservableCollection<MountedVolumeInfo> mountedDrives;
 
@@ -41,14 +40,14 @@ namespace Avalonia.Win32
                                 })
                                 .ToArray();
 
-            if (_targetObs.SequenceEqual(mountVolInfos))
+            if (mountedDrives.SequenceEqual(mountVolInfos))
                 return;
             else
             {
-                _targetObs.Clear();
+                mountedDrives.Clear();
 
                 foreach (var i in mountVolInfos)
-                    _targetObs.Add(i);
+                    mountedDrives.Add(i);
             }
         }