C#3.0 新特性系列(6) Extension Methods

You can use Extension Methods to add methods to existing types without declaring a new derived type, recomelling...

 1 namespace XuExtensionMethods
 2 {
 3     public static class XuExtensions
 4     {
 5         public static int GetMagic(this String stri)
 6         {
 7             return stri
 8         }
 9     }   
10 }
posted @ 2008-07-31 10:24  许晓光  阅读(181)  评论(0编辑  收藏  举报