コード例 #1
0
        protected virtual void OnNextProxy(ProxyEnumeratorEventArgs e)
        {
            EventHandler <ProxyEnumeratorEventArgs> handler = NextProxy;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
        protected virtual void OnProxyFound(ProxyEnumeratorEventArgs e)
        {
            EventHandler <ProxyEnumeratorEventArgs> handler = ProxyFound;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: ViterAlex/BetfredParser
        private void ProxyEnum_ProxyFound(object sender, ProxyEnumeratorEventArgs e)
        {
            var p = _proxies[e.Index];

            _proxies.RemoveAt(e.Index);
            _proxies.Insert(0, p);
            //Завершаем потоки.
            StopTimer();
            var result = LoadPage();

            if (!result.IsNullOrEmpty())
            {
                this.InvokeEx(() => StartParsing(result));
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: ViterAlex/BetfredParser
 private void ProxyEnum_NextProxy(object sender, ProxyEnumeratorEventArgs e)
 {
     this.InvokeEx(() => TaskbarProgress.SetValue(Handle, e.Index + 1, e.Count));
     proxyEnumStatusLabel.Text = string.Format("Попытка соединиться через {0}. {1} из {2}", e.Proxy.Address, e.Index, e.Count);
 }