aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-11 04:45:05 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-11 04:45:05 +0200
commita63b5db93859fac695d1b9faea23b79e3a070179 (patch)
treef8ea2bd501d6d2fb14fabac1a2989b04887444c8 /Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
parent0bd41535d72cf2e6c50267783bfd098ae5263d6e (diff)
downloadTango-a63b5db93859fac695d1b9faea23b79e3a070179.tar.gz
Tango-a63b5db93859fac695d1b9faea23b79e3a070179.zip
Fixed issues with reset counters.
Display general authorization error instead of unexpected application error. Display environment on FSE. Completed cleaner dispensing dialog. Hide/show "Open/Close dyeing head lid" on Flat/Arc. Emulator will raise proper "Opened" events after "Open dyeing head lid" command. Updated EF Extensions version to all project due to a bug in "DeleteFromQuery".
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs92
1 files changed, 53 insertions, 39 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
index b34c8c527..2ab3e5c62 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs
@@ -326,31 +326,38 @@ namespace Tango.FSE.PPCConsole.ViewModels
private async void OnItemsDroppedIn(List<FileSystemItem> items)
{
- String currentPathBefore = CurrentPath;
-
- foreach (var item in items.Where(x => x.Type != FileSystemItemType.Drive))
+ try
{
- Debug.WriteLine($"Dropped in: {item.Name} => {CurrentItem.Path}");
+ String currentPathBefore = CurrentPath;
- if ((CurrentItem as IFileSystemContainer).Items.ToList().Exists(x => x.Name.ToLower() == item.Name.ToLower()))
+ foreach (var item in items.Where(x => x.Type != FileSystemItemType.Drive))
{
- if (!await NotificationProvider.ShowWarningQuestion($"'{item.Name}' already exists on '{CurrentItem.Name}'. Do you want to overwrite?"))
+ Debug.WriteLine($"Dropped in: {item.Name} => {CurrentItem.Path}");
+
+ if ((CurrentItem as IFileSystemContainer).Items.ToList().Exists(x => x.Name.ToLower() == item.Name.ToLower()))
{
- continue;
+ if (!await NotificationProvider.ShowWarningQuestion($"'{item.Name}' already exists on '{CurrentItem.Name}'. Do you want to overwrite?"))
+ {
+ continue;
+ }
}
- }
- var handler = await FileSystemProvider.Upload(item.Path, CurrentItem);
+ var handler = await FileSystemProvider.Upload(item.Path, CurrentItem);
- handler.StatusChanged += (x, status) =>
- {
- if (status == FileSystemHandlerStatus.Completed && currentPathBefore == CurrentPath)
+ handler.StatusChanged += (x, status) =>
{
- NavigateToCurrentPath();
- }
- };
+ if (status == FileSystemHandlerStatus.Completed && currentPathBefore == CurrentPath)
+ {
+ NavigateToCurrentPath();
+ }
+ };
- FileSystemHandlers.Insert(0, handler);
+ FileSystemHandlers.Insert(0, handler);
+ }
+ }
+ catch (Exception ex)
+ {
+ await NotificationProvider.ShowError($"Error uploading to file system.\n{ex.FlattenMessage()}");
}
}
@@ -552,40 +559,47 @@ namespace Tango.FSE.PPCConsole.ViewModels
var result = await StorageProvider.SelectFilesAndFolders("Select files and folders to upload");
if (result)
{
- String currentPathBefore = CurrentPath;
-
- foreach (var item in result.SelectedItems)
- {
- if (!File.Exists(item) && !Directory.Exists(item))
- {
- await NotificationProvider.ShowError($"File or folder '{item}' cannot be uploaded.");
- return;
- }
- }
-
- foreach (var item in result.SelectedItems)
+ try
{
- String itemName = Path.GetFileName(item);
+ String currentPathBefore = CurrentPath;
- if ((CurrentItem as IFileSystemContainer).Items.ToList().Exists(x => x.Name.ToLower() == itemName.ToLower()))
+ foreach (var item in result.SelectedItems)
{
- if (!await NotificationProvider.ShowWarningQuestion($"'{itemName}' already exists on '{CurrentItem.Name}'. Do you want to overwrite?"))
+ if (!File.Exists(item) && !Directory.Exists(item))
{
- continue;
+ await NotificationProvider.ShowError($"File or folder '{item}' cannot be uploaded.");
+ return;
}
}
- var handler = await FileSystemProvider.Upload(item, CurrentItem);
-
- handler.StatusChanged += (x, status) =>
+ foreach (var item in result.SelectedItems)
{
- if (status == FileSystemHandlerStatus.Completed && currentPathBefore == CurrentPath)
+ String itemName = Path.GetFileName(item);
+
+ if ((CurrentItem as IFileSystemContainer).Items.ToList().Exists(x => x.Name.ToLower() == itemName.ToLower()))
{
- NavigateToCurrentPath();
+ if (!await NotificationProvider.ShowWarningQuestion($"'{itemName}' already exists on '{CurrentItem.Name}'. Do you want to overwrite?"))
+ {
+ continue;
+ }
}
- };
- FileSystemHandlers.Insert(0, handler);
+ var handler = await FileSystemProvider.Upload(item, CurrentItem);
+
+ handler.StatusChanged += (x, status) =>
+ {
+ if (status == FileSystemHandlerStatus.Completed && currentPathBefore == CurrentPath)
+ {
+ NavigateToCurrentPath();
+ }
+ };
+
+ FileSystemHandlers.Insert(0, handler);
+ }
+ }
+ catch (Exception ex)
+ {
+ await NotificationProvider.ShowError($"Error uploading to file system.\n{ex.FlattenMessage()}");
}
}
}