public async Task EnumerateDrivesAsync() { var cloudProviderController = new CloudProviderController(); var cloudProviders = await cloudProviderController.DetectInstalledCloudProvidersAsync(); foreach (var provider in cloudProviders) { Logger.Info($"Adding cloud provider \"{provider.Name}\" mapped to {provider.SyncFolder}"); var cloudProviderItem = new DriveItem() { Text = provider.Name, Path = provider.SyncFolder, Type = DriveType.CloudDrive, }; await CoreApplication.MainView.CoreWindow.DispatcherQueue.EnqueueAsync(async() => { cloudProviderItem.Icon = await(await FileThumbnailHelper.LoadIconWithoutOverlayAsync(provider.SyncFolder, 24)).ToBitmapAsync(); }); lock (drivesList) { if (!drivesList.Any(x => x.Path == cloudProviderItem.Path)) { drivesList.Add(cloudProviderItem); } } } await RefreshUI(); }
public async Task EnumerateDrivesAsync() { var cloudProviderController = new CloudProviderController(); var cloudProviders = await cloudProviderController.DetectInstalledCloudProvidersAsync(); foreach (var provider in cloudProviders) { Logger.Info($"Adding cloud provider \"{provider.Name}\" mapped to {provider.SyncFolder}"); var cloudProviderItem = new DriveItem() { Text = provider.Name, Path = provider.SyncFolder, Type = DriveType.CloudDrive, }; lock (drivesList) { if (!drivesList.Any(x => x.Path == cloudProviderItem.Path)) { drivesList.Add(cloudProviderItem); } } } await RefreshUI(); }
private async Task EnumerateDrivesAsync() { var cloudProviderController = new CloudProviderController(); await cloudProviderController.DetectInstalledCloudProvidersAsync(); foreach (var provider in cloudProviderController.CloudProviders) { var cloudProviderItem = new DriveItem() { Text = provider.Name, Path = provider.SyncFolder, Type = DriveType.CloudDrive, }; lock (drivesList) { drivesList.Add(cloudProviderItem); } } await RefreshUI(); }