diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-20 04:54:14 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-20 04:54:14 +0200 |
| commit | 64755b97545111599362a83b16cd201047534968 (patch) | |
| tree | 1557f8a5a8fb20fd8091222ae216fbdea98b2704 /Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs | |
| parent | d2c68a8f4d522b1b27a3ccfb28673c4053975169 (diff) | |
| download | Tango-64755b97545111599362a83b16cd201047534968.tar.gz Tango-64755b97545111599362a83b16cd201047534968.zip | |
Folder download
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs index 6eb05b70d..bcc39d11d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs @@ -73,14 +73,7 @@ namespace Tango.FSE.UI.FileSystem FileSystemHandler handler = null; - if (item.Type == FileSystemItemType.File) - { - destination = Path.Combine(localTargetFolder, item.Name); - } - else if (item.Type == FileSystemItemType.File) - { - destination = Path.Combine(localTargetFolder, item.Name); - } + destination = Path.Combine(localTargetFolder, item.Name); handler = new FileSystemHandler(item, destination, async () => @@ -184,25 +177,32 @@ namespace Tango.FSE.UI.FileSystem } } - try + if (!aborted) { - if (item.Type == FileSystemItemType.File) + try { - File.Copy(tempFile, destination, true); - tempFile.Delete(); + if (item.Type == FileSystemItemType.File) + { + File.Copy(tempFile, destination, true); + tempFile.Delete(); + } + else if (item.Type == FileSystemItemType.Folder) + { + ZipFile.ExtractToDirectory(tempFile, destination); + tempFile.Delete(); + } + + handler.RaiseCompleted(); } - else if (item.Type == FileSystemItemType.Folder) + catch (Exception ex) { - ZipFile.ExtractToDirectory(tempFile, destination); - tempFile.Delete(); + handler.RaiseFailed(ex); } } - catch (Exception ex) + else { - handler.RaiseFailed(ex); + tempFile.Delete(); } - - handler.RaiseCompleted(); }); return Task.FromResult(handler); |
