/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Utils/Cloud/Detector/BoxCloudDetector.cs
39 строк
1 KB
Yair
Code Quality: Ran code cleanup (#17307)
25 июл 2025, 03:57
Не верифицирован
25 июл 2025, 03:57
4558bc2
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using System.IO; using Windows.Storage; namespace Files.App.Utils.Cloud { /// <summary> /// Provides an utility for Box Cloud detection. /// </summary> public sealed class BoxCloudDetector : AbstractCloudDetector { protected override async IAsyncEnumerable<ICloudProvider> GetProviders() { string configPathBoxDrive = Path.Combine(UserDataPaths.GetDefault().LocalAppData, @"Box\Box\data\shell\sync_root_folder.txt"); string configPathBoxSync = Path.Combine(UserDataPaths.GetDefault().LocalAppData, @"Box Sync\sync_root_folder.txt"); StorageFile configFile = await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(configPathBoxDrive).AsTask()); configFile ??= await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(configPathBoxSync).AsTask()); if (configFile is not null) { string syncPath = await FileIO.ReadTextAsync(configFile); if (!string.IsNullOrEmpty(syncPath)) { yield return new CloudProvider(CloudProviders.Box) { Name = "Box", SyncFolder = syncPath, }; } } } } }