摘要: 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) 编辑