private async Task RegisterFolderForSync(object parameter) { await DesktopClientHelper.ShowDekstopClientInfo(); if (parameter is DavItem) { var folderPicker = new FolderPicker(); folderPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; folderPicker.FileTypeFilter.Add("."); var folder = await folderPicker.PickSingleFolderAsync(); if (folder == null) { return; } var state = await folder.GetIndexedStateAsync(); if (state == IndexedState.NotIndexed || state == IndexedState.PartiallyIndexed) { ContentDialog dialog = new ContentDialog(); dialog.Content = state == IndexedState.NotIndexed ? App.ResourceLoader.GetString("NotIndexedError") : App.ResourceLoader.GetString("PartiallyIndexedError"); dialog.PrimaryButtonText = App.ResourceLoader.GetString("yes"); dialog.SecondaryButtonText = App.ResourceLoader.GetString("no"); var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Secondary) { return; } } var fa = await _syncedFolderService.AddFolderToSyncAsync(folder, (DavItem)parameter); NavigationService.Navigate(typeof(SyncedFolderConfigurationPage), fa, new SuppressNavigationTransitionInfo()); } }
private async Task RegisterFolderForSync(object parameter) { await DesktopClientHelper.ShowDekstopClientInfo(); if (parameter is DavItem) { var folderPicker = new FolderPicker(); folderPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; folderPicker.FileTypeFilter.Add("."); var folder = await folderPicker.PickSingleFolderAsync(); if (folder == null) { return; } var state = await folder.GetIndexedStateAsync(); if (state == IndexedState.NotIndexed || state == IndexedState.PartiallyIndexed) { ContentDialog dialog = new ContentDialog(); dialog.Content = state == IndexedState.NotIndexed ? App.ResourceLoader.GetString("NotIndexedError") : App.ResourceLoader.GetString("PartiallyIndexedError"); dialog.PrimaryButtonText = App.ResourceLoader.GetString("yes"); dialog.SecondaryButtonText = App.ResourceLoader.GetString("no"); var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Secondary) { return; } } foreach (var assocaition in _syncedFolderService.GetAllSyncedFolders()) { if (String.Equals(folder.Path, assocaition.LocalFolderPath, StringComparison.OrdinalIgnoreCase)) { MessageDialog dialog = new MessageDialog(string.Format(App.ResourceLoader.GetString("SelectedFolderAlreadyInUseForSync"), folder.Path)); await dialog.ShowAsync(); return; } } var fa = await _syncedFolderService.AddFolderToSyncAsync(folder, (DavItem)parameter); NavigationService.Navigate(typeof(SyncedFolderConfigurationPage), fa, new SuppressNavigationTransitionInfo()); } }
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { Shell.HamburgerMenu.IsFullScreen = true; await DesktopClientHelper.ShowDekstopClientInfo(); }