/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Data/Contracts/IRemovableDrivesService.cs
36 строк
1 KB
Yair
Code Quality: Prevent crash when system drive is inaccessible during drive enumeration
05 май 2026, 17:26
05 май 2026, 17:26
d66213e
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Data.Contracts { /// <summary> /// Represents a service to enumerate drives and create a storage device watcher /// </summary> public interface IRemovableDrivesService { /// <summary> /// Gets the primary system drive. This item is typically excluded when enumerating removable drives /// </summary> /// <returns>The location of the drive which the operating system is installed to, or <see langword="null"/> if it cannot be accessed.</returns> Task<IFolder?> GetPrimaryDriveAsync(); /// <summary> /// Creates a watcher for storage devices /// </summary> /// <returns>The created storage device watcher</returns> IStorageDeviceWatcher CreateWatcher(); /// <summary> /// Enumerates all removable drives /// </summary> /// <returns>A collection of removable storage devices</returns> IAsyncEnumerable<IFolder> GetDrivesAsync(); /// <summary> /// Refreshes the properties of a drive /// </summary> /// <param name="drive"></param> /// <returns></returns> Task UpdateDrivePropertiesAsync(IFolder drive); } }