Ejemplo n.º 1
0
 private void View_BandwidthChangedEvent()
 {
     foreach (IProgressView progressView in View.SelectedTransfers)
     {
         Transfer transfer = GetTransferFromView(progressView);
         transfer.setBandwidth(View.Bandwidth);
         if (transfer.isRunning())
         {
             BackgroundActionRegistry registry = getRegistry();
             // Find matching background task
             for (int i = 0; i < registry.size(); i++)
             {
                 if (registry.get(i) is TransferBackgroundAction)
                 {
                     TransferBackgroundAction t = (TransferBackgroundAction)registry.get(i);
                     if (t.getTransfer().Equals(transfer))
                     {
                         TransferSpeedometer meter = t.getMeter();
                         meter.reset();
                     }
                 }
             }
         }
     }
     UpdateBandwidthPopup();
 }
Ejemplo n.º 2
0
 private void View_StopEvent()
 {
     foreach (IProgressView progressView in View.SelectedTransfers)
     {
         Transfer transfer = GetTransferFromView(progressView);
         BackgroundActionRegistry registry = getRegistry();
         if (transfer.isRunning())
         {
             // Find matching background task
             for (int i = 0; i < registry.size(); i++)
             {
                 if (registry.get(i) is TransferBackgroundAction)
                 {
                     TransferBackgroundAction t = (TransferBackgroundAction)registry.get(i);
                     if (t.getTransfer().Equals(transfer))
                     {
                         t.cancel();
                     }
                 }
             }
         }
     }
 }