The extension method.

          When you define extension methods, the first restriction is that they must be defined within a static class (see Chapter 5) and, therefore, each extension method must be declared with the static keyword.

          当你定义扩展方法时候,第一个约束他们必须定义在静态类里面,此外,每个扩展方法必须使用static关键字来声明。

         The second point is that all extension methods are marked as such by using the this keyword as a modifier on the first (and only the first) parameter of the method in question.

posted @ 2015-02-02 14:20  海川0  阅读(76)  评论(0)    收藏  举报