diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-04 14:18:28 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-04 14:18:28 +0300 |
| commit | 91d5be468e28266a4ae18ee3845f0cb3433dd898 (patch) | |
| tree | 267173e3d906a2168ac72692b8d4ec523f59d30f /Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs | |
| parent | a5c6a3baaf597ef58369192716ffe02d3af87ac2 (diff) | |
| download | Tango-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.cs | 27 |
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() |
