private void WorkerOnProxyAdded(object sender, WebProxyHolder proxy) { Application.Current.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action(() => this.viewModel.Proxies.Add(new ProxyViewModel(proxy)))) ; }
public void SetProxyAsRemoved(WebProxyHolder holder) { foreach (var proxyViewModel in Proxies.Where(proxyViewModel => proxyViewModel.Proxy == holder)) { proxyViewModel.Remove = true; break; } CurrentProxyCount--; }
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; }
private void OnDownloaderBadProxyRemoved(object sender, int threadId, WebProxyHolder proxy) { this.SetRemovedProxy(proxy); }