@@ -166,7 +166,7 @@ await DialogDisplayHelper.ShowDialogAsync(
166166 {
167167 // CopyFileFromApp only works on file not directories
168168 var fsSourceFolder = await source . ToStorageItemResult ( ) ;
169- var fsDestinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
169+ var fsDestinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
170170 var fsResult = ( FilesystemResult ) ( fsSourceFolder . ErrorCode | fsDestinationFolder . ErrorCode ) ;
171171
172172 if ( fsResult )
@@ -219,7 +219,7 @@ await DialogDisplayHelper.ShowDialogAsync(
219219 {
220220 Debug . WriteLine ( System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ) ;
221221
222- FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
222+ FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
223223 var sourceResult = await source . ToStorageItemResult ( ) ;
224224 fsResult = sourceResult . ErrorCode | destinationResult . ErrorCode ;
225225
@@ -373,7 +373,7 @@ await DialogDisplayHelper.ShowDialogAsync(
373373 Debug . WriteLine ( System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ) ;
374374
375375 var fsSourceFolder = await source . ToStorageItemResult ( ) ;
376- var fsDestinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
376+ var fsDestinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
377377 fsResult = fsSourceFolder . ErrorCode | fsDestinationFolder . ErrorCode ;
378378
379379 if ( fsResult )
@@ -432,7 +432,7 @@ await DialogDisplayHelper.ShowDialogAsync(
432432 {
433433 Debug . WriteLine ( System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ) ;
434434
435- FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
435+ FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
436436 var sourceResult = await source . ToStorageItemResult ( ) ;
437437 fsResult = sourceResult . ErrorCode | destinationResult . ErrorCode ;
438438
@@ -512,12 +512,12 @@ public async Task<IStorageHistory> DeleteAsync(IStorageItemWithPath source, IPro
512512 {
513513 if ( source . ItemType == FilesystemItemType . File )
514514 {
515- fsResult = await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( source . Path )
515+ fsResult = await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( source . Path , cancellationToken )
516516 . OnSuccess ( ( t ) => t . DeleteAsync ( permanently ? StorageDeleteOption . PermanentDelete : StorageDeleteOption . Default ) . AsTask ( ) ) ;
517517 }
518518 else if ( source . ItemType == FilesystemItemType . Directory )
519519 {
520- fsResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( source . Path )
520+ fsResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( source . Path , cancellationToken )
521521 . OnSuccess ( ( t ) => t . DeleteAsync ( permanently ? StorageDeleteOption . PermanentDelete : StorageDeleteOption . Default ) . AsTask ( ) ) ;
522522 }
523523 }
@@ -539,7 +539,7 @@ public async Task<IStorageHistory> DeleteAsync(IStorageItemWithPath source, IPro
539539 // Recycle bin also stores a file starting with $I for each item
540540 string iFilePath = Path . Combine ( Path . GetDirectoryName ( source . Path ) , Path . GetFileName ( source . Path ) . Replace ( "$R" , "$I" , StringComparison . Ordinal ) ) ;
541541
542- await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath )
542+ await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath , cancellationToken )
543543 . OnSuccess ( iFile => iFile . DeleteAsync ( StorageDeleteOption . PermanentDelete ) . AsTask ( ) ) ;
544544 }
545545 fsProgress . ReportStatus ( fsResult ) ;
@@ -738,8 +738,8 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
738738 {
739739 if ( source . ItemType == FilesystemItemType . Directory )
740740 {
741- FilesystemResult < BaseStorageFolder > sourceFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( source . Path ) ;
742- FilesystemResult < BaseStorageFolder > destinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
741+ FilesystemResult < BaseStorageFolder > sourceFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( source . Path , cancellationToken ) ;
742+ FilesystemResult < BaseStorageFolder > destinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
743743
744744 fsResult = sourceFolder . ErrorCode | destinationFolder . ErrorCode ;
745745 fsProgress . ReportStatus ( fsResult ) ;
@@ -759,8 +759,8 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
759759 }
760760 else
761761 {
762- FilesystemResult < BaseStorageFile > sourceFile = await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( source . Path ) ;
763- FilesystemResult < BaseStorageFolder > destinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
762+ FilesystemResult < BaseStorageFile > sourceFile = await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( source . Path , cancellationToken ) ;
763+ FilesystemResult < BaseStorageFolder > destinationFolder = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
764764
765765 fsResult = sourceFile . ErrorCode | destinationFolder . ErrorCode ;
766766 fsProgress . ReportStatus ( fsResult ) ;
@@ -782,7 +782,7 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
782782 // Recycle bin also stores a file starting with $I for each item
783783 string iFilePath = Path . Combine ( Path . GetDirectoryName ( source . Path ) , Path . GetFileName ( source . Path ) . Replace ( "$R" , "$I" , StringComparison . Ordinal ) ) ;
784784
785- await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath )
785+ await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath , cancellationToken )
786786 . OnSuccess ( iFile => iFile . DeleteAsync ( StorageDeleteOption . PermanentDelete ) . AsTask ( ) ) ;
787787 }
788788
0 commit comments