瑞雪年

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: :: 订阅 订阅 :: 管理 ::

在 .NET 2.0上使用“扩展方法”,真是太easy了。不用引什么System.Core, 也不用LinqBridge(http://www.albahari.com/nutshell/linqbridge.aspx).

就两行代码就搞定!

namespace System.Runtime.CompilerServices

{

    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]

    public sealed class ExtensionAttribute : Attribute {}

}

示例项目:ClassLibrary1.zip 

posted on 2010-03-02 11:35  瑞雪年  阅读(869)  评论(5编辑  收藏  举报