private void btnCallback_Click(object sender, System.EventArgs e) { ClearLog(); XmlDocument[] Documents = new XmlDocument[mUrlList.Count]; for (int i = 0; i < mUrlList.Count; i++) { Documents[i] = new XmlDocument(); DocumentLoad TheDelegate = new DocumentLoad(Documents[i].Load); AsyncCallback CallbackDelegate = new AsyncCallback(this.ReadyLoading); // We start the loading of the XMLDocument, passing it a delegate // for calling the ReadyLoading method when it is ready. A reference // to the current XmlDocument is also passed in. This will be passed // to the callback method as the AsyncState property of the IAsyncResult. TheDelegate.BeginInvoke((string)mUrlList[i], CallbackDelegate, Documents[i]); AppendLog("Started loading document from " + mUrlList[i]); } }