会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
有一
博客园
首页
新随笔
联系
订阅
管理
2011年1月21日
扩展方法(extension method)
摘要: l它必须被声明为外层静态、非泛型类中的静态方法。l它必须把被扩展的类作为第一个参数的类型,前加“this”修饰。Example: static class ExtensionMethodEample { public static int SuperAdd(this int a, int param) { returna + param * 2; } }int a = 5;int result = a.SuperAdd(10);
阅读全文
posted @ 2011-01-21 17:17 有一
阅读(218)
评论(0)
推荐(0)
编辑
公告