aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-04 14:18:28 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-04 14:18:28 +0300
commit91d5be468e28266a4ae18ee3845f0cb3433dd898 (patch)
tree267173e3d906a2168ac72692b8d4ec523f59d30f /Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs
parenta5c6a3baaf597ef58369192716ffe02d3af87ac2 (diff)
downloadTango-91d5be468e28266a4ae18ee3845f0cb3433dd898.tar.gz
Tango-91d5be468e28266a4ae18ee3845f0cb3433dd898.zip
Reset Application & Firmware "Logs" tab even when machine connection is the same.
Fixed issue on FileSystem download. Ignored issue with procedure error highlighting caused application error. Fixed issue when logout/login with different environment did not refreshed the list of available machines for connection.
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs27
1 files changed, 20 insertions, 7 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs
index b1f4446d2..ab6a788f2 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs
@@ -15,6 +15,7 @@ namespace Tango.FSE.Common.FileSystem
private System.Timers.Timer _transferRateTimer;
private double _lastPosition;
private TaskCompletionSource<FileSystemHandlerStatus> _completionSource;
+ private bool _completed;
public event EventHandler<FileSystemHandlerStatus> StatusChanged;
public event EventHandler<TangoProgressChangedEventArgs<double>> ProgressChanged;
@@ -134,21 +135,33 @@ namespace Tango.FSE.Common.FileSystem
internal void RaiseFailed(Exception exception)
{
- Status = FileSystemHandlerStatus.Failed;
- FailedException = exception;
- _completionSource.SetException(exception);
+ if (!_completed)
+ {
+ _completed = true;
+ Status = FileSystemHandlerStatus.Failed;
+ FailedException = exception;
+ _completionSource.SetException(exception);
+ }
}
internal void RaiseAborted()
{
- Status = FileSystemHandlerStatus.Aborted;
- _completionSource.SetException(new OperationCanceledException("File system operation aborted."));
+ if (!_completed)
+ {
+ _completed = true;
+ Status = FileSystemHandlerStatus.Aborted;
+ _completionSource.SetException(new OperationCanceledException("File system operation aborted."));
+ }
}
internal void RaiseCompleted()
{
- Status = FileSystemHandlerStatus.Completed;
- _completionSource.SetResult(Status);
+ if (!_completed)
+ {
+ _completed = true;
+ Status = FileSystemHandlerStatus.Completed;
+ _completionSource.SetResult(Status);
+ }
}
public void Abort()