Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Threading Conversion

Threading Conversion

Scheduled Pinned Locked Moved C#
csharpcsshelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eatwork
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • E 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

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      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

      E 1 Reply Last reply
      0
      • L 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

        E Offline
        E Offline
        eatwork
        wrote on last edited by
        #3

        Hi led mike, Thanks for your help. I was able to create a seperate function and delegate in place of his delegate code. Still don't understand what exactly his code does, but I got it to work some how. Thanks again

        eatwork

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups