From 91d5be468e28266a4ae18ee3845f0cb3433dd898 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 4 Aug 2020 14:18:28 +0300 Subject: 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. --- .../FileSystem/FileSystemHandler.cs | 27 ++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/FileSystemHandler.cs') 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 _completionSource; + private bool _completed; public event EventHandler StatusChanged; public event EventHandler> 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() -- cgit v1.3.1