标签:sha font 方法 指定 div 函数 gate har ali
委托的特点
delegate的用法
delegate void BookDelegate(string a,string b); public MainWindow() { InitializeComponent(); BookDelegate method = new BookDelegate(Book); method("Hello", "World"); } public void Book(string a, string b) { }
Action的用法
Action<string, string> BookAction = new Action<string, string>(Book); public MainWindow() { InitializeComponent(); BookAction("Hello", "World"); } public static void Book(string a, string b) { }
Func的用法
Func<string, string, string> FuncBook = new Func<string, string, string>(Book); public MainWindow() { InitializeComponent(); Book("Hello", "World"); } public static string Book(string a, string b) { return String.Format("{0}{1}", a, b); }
总结
标签:sha font 方法 指定 div 函数 gate har ali
原文地址:https://www.cnblogs.com/sntetwt/p/11170938.html