File tree 3 files changed +35
-1
lines changed
src/Files.App/Utils/Cloud
3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ public enum CloudProviders
45
45
46
46
LucidLink ,
47
47
48
- kDrive
48
+ kDrive ,
49
+
50
+ Sync
49
51
}
50
52
}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ private static IEnumerable<ICloudDetector> EnumerateDetectors()
34
34
yield return new GenericCloudDetector ( ) ;
35
35
yield return new SynologyDriveCloudDetector ( ) ;
36
36
yield return new LucidLinkCloudDetector ( ) ;
37
+ yield return new SyncCloudDetector ( ) ;
37
38
}
38
39
}
39
40
}
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