Pass a method as an argument

后端 未结 5 1445
离开以前
离开以前 2020-12-31 20:12

How do I pass a method as an argument? I do this all the time in Javascript and need to use anonymous methods to pass params. How do I do it in c#?

protecte         


        
5条回答
  •  借酒劲吻你
    2020-12-31 21:03

    Take a look at C# Delegates

    http://msdn.microsoft.com/en-us/library/ms173171(VS.80).aspx

    Tutorial http://www.switchonthecode.com/tutorials/csharp-tutorial-the-built-in-generic-delegate-declarations

提交回复
热议问题