Example #1
0
        private void UpdateActiveTransfer(string key, TransferFileProgressArgs value)
        {
            bool contains = ActiveTransfers.ContainsKey(key);

            if (contains)
            {
                ActiveTransfers[key] = value;
            }
        }
Example #2
0
        private void AddActiveTransfer(string key, TransferFileProgressArgs value)
        {
            bool contains = ActiveTransfers.ContainsKey(key);

            if (!contains)
            {
                ActiveTransfers.Add(key, value);
            }
        }
Example #3
0
 internal void OnCompleted(object sender, TransferFileProgressArgs args)
 {
     RemoveActiveTransfer(args.FilePath);
     if (Completed != null)
     {
         Completed.Invoke(sender, args);
     }
     if (Monitor != null)
     {
         Monitor.TransferCompleted(this, args);
     }
 }
Example #4
0
 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);
     }
 }
Example #5
0
 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);
     }
 }
Example #6
0
 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);
     }
 }