@@ -166,7 +166,7 @@ await DialogDisplayHelper.ShowDialogAsync(
166
166
{
167
167
// CopyFileFromApp only works on file not directories
168
168
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 ) ;
170
170
var fsResult = ( FilesystemResult ) ( fsSourceFolder . ErrorCode | fsDestinationFolder . ErrorCode ) ;
171
171
172
172
if ( fsResult )
@@ -219,7 +219,7 @@ await DialogDisplayHelper.ShowDialogAsync(
219
219
{
220
220
Debug . WriteLine ( System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ) ;
221
221
222
- FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
222
+ FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
223
223
var sourceResult = await source . ToStorageItemResult ( ) ;
224
224
fsResult = sourceResult . ErrorCode | destinationResult . ErrorCode ;
225
225
@@ -373,7 +373,7 @@ await DialogDisplayHelper.ShowDialogAsync(
373
373
Debug . WriteLine ( System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ) ;
374
374
375
375
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 ) ;
377
377
fsResult = fsSourceFolder . ErrorCode | fsDestinationFolder . ErrorCode ;
378
378
379
379
if ( fsResult )
@@ -432,7 +432,7 @@ await DialogDisplayHelper.ShowDialogAsync(
432
432
{
433
433
Debug . WriteLine ( System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ) ;
434
434
435
- FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) ) ;
435
+ FilesystemResult < BaseStorageFolder > destinationResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( PathNormalization . GetParentDir ( destination ) , cancellationToken ) ;
436
436
var sourceResult = await source . ToStorageItemResult ( ) ;
437
437
fsResult = sourceResult . ErrorCode | destinationResult . ErrorCode ;
438
438
@@ -512,12 +512,12 @@ public async Task<IStorageHistory> DeleteAsync(IStorageItemWithPath source, IPro
512
512
{
513
513
if ( source . ItemType == FilesystemItemType . File )
514
514
{
515
- fsResult = await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( source . Path )
515
+ fsResult = await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( source . Path , cancellationToken )
516
516
. OnSuccess ( ( t ) => t . DeleteAsync ( permanently ? StorageDeleteOption . PermanentDelete : StorageDeleteOption . Default ) . AsTask ( ) ) ;
517
517
}
518
518
else if ( source . ItemType == FilesystemItemType . Directory )
519
519
{
520
- fsResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( source . Path )
520
+ fsResult = await _associatedInstance . ShellViewModel . GetFolderFromPathAsync ( source . Path , cancellationToken )
521
521
. OnSuccess ( ( t ) => t . DeleteAsync ( permanently ? StorageDeleteOption . PermanentDelete : StorageDeleteOption . Default ) . AsTask ( ) ) ;
522
522
}
523
523
}
@@ -539,7 +539,7 @@ public async Task<IStorageHistory> DeleteAsync(IStorageItemWithPath source, IPro
539
539
// Recycle bin also stores a file starting with $I for each item
540
540
string iFilePath = Path . Combine ( Path . GetDirectoryName ( source . Path ) , Path . GetFileName ( source . Path ) . Replace ( "$R" , "$I" , StringComparison . Ordinal ) ) ;
541
541
542
- await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath )
542
+ await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath , cancellationToken )
543
543
. OnSuccess ( iFile => iFile . DeleteAsync ( StorageDeleteOption . PermanentDelete ) . AsTask ( ) ) ;
544
544
}
545
545
fsProgress . ReportStatus ( fsResult ) ;
@@ -738,8 +738,8 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
738
738
{
739
739
if ( source . ItemType == FilesystemItemType . Directory )
740
740
{
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 ) ;
743
743
744
744
fsResult = sourceFolder . ErrorCode | destinationFolder . ErrorCode ;
745
745
fsProgress . ReportStatus ( fsResult ) ;
@@ -759,8 +759,8 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
759
759
}
760
760
else
761
761
{
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 ) ;
764
764
765
765
fsResult = sourceFile . ErrorCode | destinationFolder . ErrorCode ;
766
766
fsProgress . ReportStatus ( fsResult ) ;
@@ -782,7 +782,7 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
782
782
// Recycle bin also stores a file starting with $I for each item
783
783
string iFilePath = Path . Combine ( Path . GetDirectoryName ( source . Path ) , Path . GetFileName ( source . Path ) . Replace ( "$R" , "$I" , StringComparison . Ordinal ) ) ;
784
784
785
- await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath )
785
+ await _associatedInstance . ShellViewModel . GetFileFromPathAsync ( iFilePath , cancellationToken )
786
786
. OnSuccess ( iFile => iFile . DeleteAsync ( StorageDeleteOption . PermanentDelete ) . AsTask ( ) ) ;
787
787
}
788
788
0 commit comments