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

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

            if (!contains)
            {
                ActiveTransfers.Add(key, value);
            }
        }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }