private void UpdateActiveTransfer(string key, TransferFileProgressArgs value) { bool contains = ActiveTransfers.ContainsKey(key); if (contains) { ActiveTransfers[key] = value; } }
private void AddActiveTransfer(string key, TransferFileProgressArgs value) { bool contains = ActiveTransfers.ContainsKey(key); if (!contains) { ActiveTransfers.Add(key, value); } }
internal void OnCompleted(object sender, TransferFileProgressArgs args) { RemoveActiveTransfer(args.FilePath); if (Completed != null) { Completed.Invoke(sender, args); } if (Monitor != null) { Monitor.TransferCompleted(this, args); } }
internal void OnProgress(object sender, TransferFileProgressArgs args) { UpdateActiveTransfer(args.FilePath, args); if (Progress != null) { Progress.Invoke(sender, args); } if (Monitor != null) { Monitor.TransferProgress(this, args); } }
internal void OnStarted(object sender, TransferFileProgressArgs args) { AddActiveTransfer(args.FilePath, args); if (Started != null) { Started.Invoke(sender, args); } if (Monitor != null) { Monitor.TransferStarted(this, args); } }
internal void OnFailed(object sender, TransferFileProgressArgs args) { RemoveActiveTransfer(args.FilePath); ErrorMessages.Add(string.Format("{0} failed: {1}", args.FilePath, args.Exception.Message)); if (Failed != null) { Failed.Invoke(sender, args); } if (Monitor != null) { Monitor.TransferFailed(this, args); } }