Exemplo n.º 1
0
 private void WorkerOnProxyAdded(object sender, WebProxyHolder proxy)
 {
     Application.Current.Dispatcher.BeginInvoke(
         DispatcherPriority.Background,
         new Action(() =>
                    this.viewModel.Proxies.Add(new ProxyViewModel(proxy))))
     ;
 }
Exemplo n.º 2
0
 public void SetProxyAsRemoved(WebProxyHolder holder)
 {
     foreach (var proxyViewModel in Proxies.Where(proxyViewModel => proxyViewModel.Proxy == holder))
     {
         proxyViewModel.Remove = true;
         break;
     }
     CurrentProxyCount--;
 }
Exemplo n.º 3
0
 private void SetRemovedProxy(WebProxyHolder proxy)
 {
     if (this.Dispatcher.CheckAccess())
     {
         this.viewModel.SetProxyAsRemoved(proxy);
     }
     else
     {
         SetWebHolderCallback d = new SetWebHolderCallback(SetRemovedProxy);
         this.Dispatcher.Invoke(d, new object[] { proxy });
     }
 }
 public ProxyViewModel(WebProxyHolder holder)
 {
     Proxy = holder;
 }
Exemplo n.º 5
0
 private void OnDownloaderBadProxyRemoved(object sender, int threadId, WebProxyHolder proxy)
 {
     this.SetRemovedProxy(proxy);
 }