The new usage of c # Invoke

With Lamda expression in C # 3.0 and later versions, such as the above anonymous delegates have a more concise wording. .NET Framework 3.5 or later versions with more Action packaging method. For example, the following wording may seem very simple:

void ButtonOnClick(object sender,EventArgs e)

{

    this.Invoke(new Action(()=>

    {

        button.Text = "OFF";

    }));

}

Guess you like

Origin www.cnblogs.com/xihong2014/p/11005623.html