private void AddUploadHandle(TransferHandle h) { Invoke(() => Transfers.Add(h)); h.PropertyChanged += (source, e) => { if (e.PropertyName == "Status") { if (((TransferHandle)source).Status == TransferHandleStatus.Uploading) { Status = ConnectivityStatus.Uploading; } else { if (Transfers.All(t => t.Status == TransferHandleStatus.Success || t.Status == TransferHandleStatus.Cancelled || t.Status == TransferHandleStatus.Error)) { Status = ConnectivityStatus.Online; } } } }; h.TransferEnded += (s1, e1) => { AppendNode(h.Node); }; }
private void AddDownloadHandle(TransferHandle h) { Invoke(() => Transfers.Add(h)); h.TransferEnded += (s1, e1) => { if (Transfers.All(t => t.Progress >= 100)) { Status = ConnectivityStatus.Online; } }; }