diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Storage/StorageFileHandler.cs | 23 |
1 files changed, 21 insertions, 2 deletions
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); } } |
