|
7 | 7 | using System.Text;
|
8 | 8 | using Windows.Foundation.Metadata;
|
9 | 9 | using Windows.Storage;
|
| 10 | +using Windows.Win32; |
10 | 11 |
|
11 | 12 | namespace Files.App.Utils.Storage
|
12 | 13 | {
|
@@ -210,7 +211,7 @@ await DialogDisplayHelper.ShowDialogAsync(
|
210 | 211 | }
|
211 | 212 | else if (source.ItemType == FilesystemItemType.File)
|
212 | 213 | {
|
213 |
| - var fsResult = (FilesystemResult)await Task.Run(() => NativeFileOperationsHelper.CopyFileFromApp(source.Path, destination, true)); |
| 214 | + var fsResult = (FilesystemResult)await Task.Run(() => PInvoke.CopyFileFromApp(source.Path, destination, true)); |
214 | 215 |
|
215 | 216 | if (!fsResult)
|
216 | 217 | {
|
@@ -363,7 +364,7 @@ await DialogDisplayHelper.ShowDialogAsync(
|
363 | 364 | }
|
364 | 365 | else
|
365 | 366 | {
|
366 |
| - var fsResult = (FilesystemResult)await Task.Run(() => NativeFileOperationsHelper.MoveFileFromApp(source.Path, destination)); |
| 367 | + var fsResult = (FilesystemResult)await Task.Run(() => PInvoke.MoveFileFromApp(source.Path, destination)); |
367 | 368 |
|
368 | 369 | if (!fsResult)
|
369 | 370 | {
|
@@ -423,7 +424,7 @@ await DialogDisplayHelper.ShowDialogAsync(
|
423 | 424 | }
|
424 | 425 | else if (source.ItemType == FilesystemItemType.File)
|
425 | 426 | {
|
426 |
| - var fsResult = (FilesystemResult)await Task.Run(() => NativeFileOperationsHelper.MoveFileFromApp(source.Path, destination)); |
| 427 | + var fsResult = (FilesystemResult)await Task.Run(() => PInvoke.MoveFileFromApp(source.Path, destination)); |
427 | 428 |
|
428 | 429 | if (!fsResult)
|
429 | 430 | {
|
@@ -620,7 +621,7 @@ public async Task<IStorageHistory> RenameAsync(
|
620 | 621 | {
|
621 | 622 | // Try again with MoveFileFromApp
|
622 | 623 | var destination = Path.Combine(Path.GetDirectoryName(source.Path), newName);
|
623 |
| - if (NativeFileOperationsHelper.MoveFileFromApp(source.Path, destination)) |
| 624 | + if (PInvoke.MoveFileFromApp(source.Path, destination)) |
624 | 625 | {
|
625 | 626 | fsProgress.ReportStatus(FileSystemStatusCode.Success);
|
626 | 627 |
|
@@ -729,7 +730,7 @@ public async Task<IStorageHistory> RestoreFromTrashAsync(IStorageItemWithPath so
|
729 | 730 |
|
730 | 731 | FilesystemResult fsResult = FileSystemStatusCode.InProgress;
|
731 | 732 |
|
732 |
| - fsResult = (FilesystemResult)await Task.Run(() => NativeFileOperationsHelper.MoveFileFromApp(source.Path, destination)); |
| 733 | + fsResult = (FilesystemResult)await Task.Run(() => PInvoke.MoveFileFromApp(source.Path, destination)); |
733 | 734 |
|
734 | 735 | if (!fsResult)
|
735 | 736 | {
|
|
0 commit comments