コード例 #1
0
        protected virtual void OnCompleted(WorkItemCompletedEventArgs e)
        {
            //raise the Completed event ***on the form's synchronisation context***
            EventHandler <WorkItemCompletedEventArgs> temp = this.Completed;

            if (temp != null)
            {
                temp.Invoke(this, e);
            }
        }
コード例 #2
0
 //handler method to run when work has completed
 private void item_Completed(object sender, WorkItemCompletedEventArgs e)
 {
     //GUI is free to update itself
     this.Result = e.Result;
 }