예제 #1
0
        protected virtual void OnCompleted(WorkItemCompletedEventArgs Args)
        {
            //raise the Completed event in the context of the form
            EventHandler <WorkItemCompletedEventArgs> temp = Completed;

            if (temp != null)
            {
                temp.Invoke(this, Args);
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: imgits/WebCrawler
        //handler method to run when work has completed
        private void WorkThread_Completed(object sender, WorkItemCompletedEventArgs e)
        {
            lvMain.Items[int.Parse(e.Result.ItemID)].SubItems[1].Text = e.Result.ResultCode;
            if (e.Result.ResultCode == "ERR")
            {
                lvMain.Items[int.Parse(e.Result.ItemID)].SubItems[2].Text = e.Result.Message;
            }

            RunningThreadCount--;
            UpdateThreadCount();

            if (RunningThreadCount == 0)
            {
                CleanUp();
            }
        }