using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; namespace ConsoleApp3 { static class Program { delegate string delagateA(string paramA); static void Main(string[] args) { delagateA delagatea = (a) =>…
首先介绍下,winform中可以用this.invoke来实现:wpf中要使用调度器Control.Despite.invoke: (Action)(()=> { })和 new Action (()=>{ button1.Content = "Action"; })是等价的 using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.…
delegate event action func 匿名方法 lambda表达式 delegate类似c++的函数指针,但是是类型安全的,可以指向多个函数, public delegate void DelegateMethod(); //声明了一个Delegate Type public DelegateMethod delegateMethod; //声明了一个Delegate对象 var test = new TestDelegate(); test.delegateMethod = n…