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 }
2 {
3 public static class XuExtensions
4 {
5 public static int GetMagic(this String stri)
6 {
7 return stri
8 }
9 }
10 }