From 9e6d1ddfb42c4e8357bd75c2b1d6f84df1ea1966 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 29 Nov 2018 13:15:09 +0200 Subject: Working on machine studio storage module. --- .../Storage/StorageFileHandler.cs | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs') diff --git a/Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs b/Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs index 72a4b2c87..6a9c5cae4 100644 --- a/Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs @@ -21,9 +21,19 @@ namespace Tango.Integration.Storage } - internal StorageFileHandler(Action cancelAction) + internal StorageFileHandler(StorageFile storageFile, Action cancelAction) { _cancelAction = cancelAction; + StorageFile = storageFile; + } + + public StorageFile StorageFile { get; set; } + + private StorageFileHandlerStatus _status; + public StorageFileHandlerStatus Status + { + get { return _status; } + private set { _status = value; RaisePropertyChangedAuto(); } } private long _current; @@ -38,6 +48,11 @@ namespace Tango.Integration.Storage Current = _current, Total = _total, }); + + if (Status != StorageFileHandlerStatus.Active) + { + Status = StorageFileHandlerStatus.Active; + } } } @@ -53,21 +68,25 @@ namespace Tango.Integration.Storage return Task.Factory.StartNew(() => { _cancelAction.Invoke(); - }); + Status = StorageFileHandlerStatus.Canceled; + }); } internal void RaiseCompleted() { + Status = StorageFileHandlerStatus.Completed; Completed?.Invoke(this, new EventArgs()); } internal void RaiseCanceled() { + Status = StorageFileHandlerStatus.Canceled; Canceled?.Invoke(this, new EventArgs()); } internal void RaiseFailed(Exception ex) { + Status = StorageFileHandlerStatus.Failed; Failed?.Invoke(this, ex); } } -- cgit v1.3.1