急需翻译C#

来源:百度知道 编辑:UC知道 时间:2024/06/17 01:51:33
The syntax is a bit clunky because it explicitly implies knowing that there is a method
that operates on a list. It would be better if you could declare a list, and then, using IntelliSense,
see the availability of the method. In C# 3.0, this is possible via extension methods that allow
a developer to make it appear as if a type were extended, without extending it. Thus the extension
methods allow you, in the context of the example, to write the following code.
The Iterate() method appears to be an extension of IList, without having to change
IList. Extension methods are declared by having a static class with a static method, and the
first parameter prefixed with this. This first parameter is no longer needed in the method call,
but represents the type to be extended.
希望翻译的专业点 不要用软件 谢谢了

这里的语法有点笨拙,这种写法暗示了这里有一个用于操作列表的方法。如果在此处声明一个列表,并使用InstelliSense操作它,那么将更易于了解这个可用的方法。在C#3.0中,经由“扩展方法”的方式允许开发人员扩展某种固有类型的方法,使其看起来和系统库提供的一样。如下述代码示例

我们通过“扩展方法”,在不改变IList的基础上实现了其扩展Iterate()。“扩展方法”声明为一个静态类中的一个静态方法,而其第一个参数代表了此方法用来扩展那种固有类型。当我们调用这个“扩展方法”时,不再需要输入这个参数。

语法有点笨重,因为它明确地意味着明知是有方法
经营名单上。这将是更好的如果你可以宣布的名单,然后,利用智能,
见的可用性方法。在C # 3.0 ,这是可能通过推广方法,使
开发商使其出现,犹如一类被延长,但延长。因此,延长
方法可以让你的背景下例如,写下面的代码。
该迭代( )方法似乎是一个延长IList ,无需改变
IList 。延期申报的方法是通过一个静态类的静态方法,并
第一个参数前缀这一点。这是第一个参数是不再需要在方法调用,
但代表类型予以延长。

这是C#2008 从入门到精通?