/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Utils/Cloud/Detector/CloudDetector.cs
37 строк
1010 B
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. namespace Files.App.Utils.Cloud { /// <summary> /// Provides an utility for cloud detection. /// </summary> public sealed class CloudDetector : ICloudDetector { public async Task<IEnumerable<ICloudProvider>> DetectCloudProvidersAsync() { var tasks = new List<Task<IEnumerable<ICloudProvider>>>(); foreach (var detector in EnumerateDetectors()) tasks.Add(detector.DetectCloudProvidersAsync()); await Task.WhenAll(tasks); return tasks .SelectMany(task => task.Result) .OrderBy(task => task.ID.ToString()) .ThenBy(task => task.Name) .Distinct(); } private static IEnumerable<ICloudDetector> EnumerateDetectors() { yield return new GoogleDriveCloudDetector(); yield return new DropBoxCloudDetector(); yield return new BoxCloudDetector(); yield return new GenericCloudDetector(); yield return new SynologyDriveCloudDetector(); yield return new OXDriveCloudDetector(); } } }