File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
src/Files.App/Utils/Cloud Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ public enum CloudProviders
4545
4646 LucidLink ,
4747
48- kDrive
48+ kDrive ,
49+
50+ Sync
4951 }
5052}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ private static IEnumerable<ICloudDetector> EnumerateDetectors()
3434 yield return new GenericCloudDetector ( ) ;
3535 yield return new SynologyDriveCloudDetector ( ) ;
3636 yield return new LucidLinkCloudDetector ( ) ;
37+ yield return new SyncCloudDetector ( ) ;
3738 }
3839 }
3940}
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+ using Windows . Storage ;
3+
4+ namespace Files . App . Utils . Cloud
5+ {
6+ /// <summary>
7+ /// Provides a utility for Sync Cloud detection.
8+ /// </summary>
9+ public sealed class SyncCloudDetector : AbstractCloudDetector
10+ {
11+ protected override async IAsyncEnumerable < ICloudProvider > GetProviders ( )
12+ {
13+ string syncFolderPath = Path . Combine ( Constants . UserEnvironmentPaths . HomePath , "Sync" ) ;
14+
15+ if ( Directory . Exists ( syncFolderPath ) )
16+ {
17+ foreach ( string directory in Directory . GetDirectories ( syncFolderPath ) )
18+ {
19+ var folder = await StorageFolder . GetFolderFromPathAsync ( directory ) ;
20+
21+ yield return new CloudProvider ( CloudProviders . Sync )
22+ {
23+ Name = $ "Sync - { folder . Name } ",
24+ SyncFolder = directory ,
25+ // IconData = (needs icon)
26+ } ;
27+ }
28+ }
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments