@@ -20,7 +20,9 @@ public enum KnownCloudProviders
20
20
OneDriveBusiness ,
21
21
Mega ,
22
22
GoogleDrive ,
23
- DropBox
23
+ DropBox ,
24
+ iCloud ,
25
+ Box
24
26
}
25
27
26
28
public class CloudProvider
@@ -36,9 +38,59 @@ public static async Task<List<CloudProvider>> GetInstalledCloudProviders()
36
38
await DetectGoogleDriveAsync ( providerList ) ;
37
39
await DetectDropboxAsync ( providerList ) ;
38
40
await DetectMegaAsync ( providerList ) ;
41
+ await DetectBoxAsync ( providerList ) ;
42
+ await DetectiCloudAsync ( providerList ) ;
39
43
return providerList ;
40
44
}
41
45
46
+ #region Box
47
+ private static async Task DetectBoxAsync ( List < CloudProvider > providerList )
48
+ {
49
+ try
50
+ {
51
+ var infoPath = @"Box\Box\data\shell\sync_root_folder.txt" ;
52
+ var configPath = Path . Combine ( UserDataPaths . GetDefault ( ) . LocalAppData , infoPath ) ;
53
+ var configFile = await StorageFile . GetFileFromPathAsync ( configPath ) ;
54
+ var syncPath = await FileIO . ReadTextAsync ( configFile ) ;
55
+ if ( ! string . IsNullOrEmpty ( syncPath ) )
56
+ {
57
+ providerList . Add ( new CloudProvider ( )
58
+ {
59
+ ID = KnownCloudProviders . Box ,
60
+ SyncFolder = syncPath ,
61
+ Name = "Box"
62
+ } ) ;
63
+ }
64
+ }
65
+ catch
66
+ {
67
+ // Not detected
68
+ }
69
+ }
70
+ #endregion
71
+
72
+ #region iCloud
73
+ private static async Task DetectiCloudAsync ( List < CloudProvider > providerList )
74
+ {
75
+ try
76
+ {
77
+ var userPath = UserDataPaths . GetDefault ( ) . Profile ;
78
+ var iCloudPath = "iCloudDrive" ;
79
+ var driveFolder = await StorageFolder . GetFolderFromPathAsync ( Path . Combine ( userPath , iCloudPath ) ) ;
80
+ providerList . Add ( new CloudProvider ( )
81
+ {
82
+ ID = KnownCloudProviders . iCloud ,
83
+ SyncFolder = driveFolder . Path ,
84
+ Name = "iCloud"
85
+ } ) ;
86
+ }
87
+ catch
88
+ {
89
+ // Not detected
90
+ }
91
+ }
92
+ #endregion
93
+
42
94
#region DropBox
43
95
private static async Task DetectDropboxAsync ( List < CloudProvider > providerList )
44
96
{
0 commit comments