@@ -41,6 +41,9 @@ public Preferences()
41
41
VideosL . IsEnabled = true ;
42
42
VideosL . Text = localSettings . Values [ "VideosLocation" ] . ToString ( ) ;
43
43
44
+ OneDriveL . IsEnabled = true ;
45
+ OneDriveL . Text = localSettings . Values [ "OneDriveLocation" ] . ToString ( ) ;
46
+
44
47
SaveCustomL . IsEnabled = true ;
45
48
}
46
49
else
@@ -53,6 +56,7 @@ public Preferences()
53
56
MusicL . IsEnabled = false ;
54
57
VideosL . IsEnabled = false ;
55
58
SaveCustomL . IsEnabled = false ;
59
+ OneDriveL . IsEnabled = false ;
56
60
}
57
61
}
58
62
else
@@ -65,6 +69,7 @@ public Preferences()
65
69
MusicL . IsEnabled = false ;
66
70
VideosL . IsEnabled = false ;
67
71
SaveCustomL . IsEnabled = false ;
72
+ OneDriveL . IsEnabled = false ;
68
73
}
69
74
SuccessMark . Visibility = Windows . UI . Xaml . Visibility . Collapsed ;
70
75
}
@@ -93,12 +98,16 @@ private void ToggleSwitch_Toggled(object sender, Windows.UI.Xaml.RoutedEventArgs
93
98
VideosL . IsEnabled = true ;
94
99
localSettings . Values [ "VideosLocation" ] = App . VideosPath ;
95
100
101
+ OneDriveL . IsEnabled = true ;
102
+ localSettings . Values [ "OneDriveLocation" ] = App . OneDrivePath ;
103
+
96
104
DesktopL . Text = localSettings . Values [ "DesktopLocation" ] . ToString ( ) ;
97
105
DownloadsL . Text = localSettings . Values [ "DownloadsLocation" ] . ToString ( ) ;
98
106
DocumentsL . Text = localSettings . Values [ "DocumentsLocation" ] . ToString ( ) ;
99
107
PictureL . Text = localSettings . Values [ "PicturesLocation" ] . ToString ( ) ;
100
108
MusicL . Text = localSettings . Values [ "MusicLocation" ] . ToString ( ) ;
101
109
VideosL . Text = localSettings . Values [ "VideosLocation" ] . ToString ( ) ;
110
+ OneDriveL . Text = localSettings . Values [ "OneDriveLocation" ] . ToString ( ) ;
102
111
103
112
SaveCustomL . IsEnabled = true ;
104
113
}
@@ -111,6 +120,7 @@ private void ToggleSwitch_Toggled(object sender, Windows.UI.Xaml.RoutedEventArgs
111
120
PictureL . IsEnabled = false ;
112
121
MusicL . IsEnabled = false ;
113
122
VideosL . IsEnabled = false ;
123
+ OneDriveL . IsEnabled = false ;
114
124
SaveCustomL . IsEnabled = false ;
115
125
}
116
126
}
@@ -241,6 +251,26 @@ private async void SaveCustomL_Click(object sender, Windows.UI.Xaml.RoutedEventA
241
251
}
242
252
}
243
253
254
+ if ( ! string . IsNullOrEmpty ( OneDriveL . Text ) )
255
+ {
256
+ try
257
+ {
258
+ newLocationSetting = await StorageFolder . GetFolderFromPathAsync ( OneDriveL . Text ) ;
259
+ localSettings . Values [ "OneDriveLocation" ] = OneDriveL . Text ;
260
+ OneDriveL . BorderBrush = new SolidColorBrush ( Colors . Black ) ;
261
+ }
262
+ catch ( ArgumentException )
263
+ {
264
+ OneDriveL . BorderBrush = new SolidColorBrush ( Color . FromArgb ( 255 , 255 , 0 , 0 ) ) ;
265
+ isFlawless = false ;
266
+ }
267
+ catch ( FileNotFoundException )
268
+ {
269
+ OneDriveL . BorderBrush = new SolidColorBrush ( Color . FromArgb ( 255 , 255 , 0 , 0 ) ) ;
270
+ isFlawless = false ;
271
+ }
272
+ }
273
+
244
274
if ( isFlawless )
245
275
{
246
276
SuccessMark . Visibility = Windows . UI . Xaml . Visibility . Visible ;
0 commit comments