Threading Conversion
-
Hi I found some code in an article posted on code project "Asynchronous Method Invocation" and was trying to follow the article, and convert it to vb.net, and got stuck at the last section of the article. I was wondering if anyone out there knows what the code below does, and how to convert it to vb.net. I am most confused with the "MethodInvoker updateGrid = delegate {m_grid.Datasource = ds.Tables[0];}; Thank you private void CallBack(IAsyncResult ar) { // get the dataset as output DataSet ds = m_invokeMe.EndInvoke(ar); // update the grid a thread safe fasion! MethodInvoker updateGrid = delegate { m_grid.DataSource = ds.Tables[0]; }; if (m_grid.InvokeRequired) m_grid.Invoke(updateGrid); else updateGrid(); }
eatwork
-
Hi I found some code in an article posted on code project "Asynchronous Method Invocation" and was trying to follow the article, and convert it to vb.net, and got stuck at the last section of the article. I was wondering if anyone out there knows what the code below does, and how to convert it to vb.net. I am most confused with the "MethodInvoker updateGrid = delegate {m_grid.Datasource = ds.Tables[0];}; Thank you private void CallBack(IAsyncResult ar) { // get the dataset as output DataSet ds = m_invokeMe.EndInvoke(ar); // update the grid a thread safe fasion! MethodInvoker updateGrid = delegate { m_grid.DataSource = ds.Tables[0]; }; if (m_grid.InvokeRequired) m_grid.Invoke(updateGrid); else updateGrid(); }
eatwork
eatwork wrote:
I am most confused with the "MethodInvoker updateGrid = delegate {m_grid.Datasource = ds.Tables[0];};
Well I could try to introduce the concepts to you ......... or I could use Google to find an MSDN Article[^] .... guess which option I went with? :rolleyes:
led mike
-
eatwork wrote:
I am most confused with the "MethodInvoker updateGrid = delegate {m_grid.Datasource = ds.Tables[0];};
Well I could try to introduce the concepts to you ......... or I could use Google to find an MSDN Article[^] .... guess which option I went with? :rolleyes:
led mike