예제 #1
0
        private void Crawler_CrawlerStopped(crawler obj)
        {
            Action action = () => lblInfo.Text = "爬虫已停止";

            if (this.InvokeRequired)
            {
                this.Invoke(action);
            }
            else
            {
                action();
            }
        }
예제 #2
0
        private void Crawler_PageDownloaded(crawler crawler, string url, string status)
        {
            var    pageInfo = new { Index = resultBindingSource.Count + 1, URL = url, Status = status };
            Action action   = () => { resultBindingSource.Add(pageInfo); };

            if (this.InvokeRequired)
            {
                this.Invoke(action);
            }
            else
            {
                action();
            }
        }