摘要: 一.扩展方法: 扩展方法的行为和静态方法是非常类似的,你只能在静态类中声明它们。为声明一个扩展方法,你需要给该方法的第一个参数指定this关键字(必须这么做),如下例:优点是:通过IntelliSense查看匿名类型,这样更容易 找到需要的功能。// Program.cs public static class EMClass { public static int ToInt32Ext(this string s) { return Int32.Parse(s); } public static int T... 阅读全文
posted @ 2013-12-05 23:03 Joe-xin 阅读(1324) 评论(0) 推荐(0) 编辑