翻译C#2008从入门到精通 出现问题了

来源:百度知道 编辑:UC知道 时间:2024/06/05 12:32:01
The declaration of the delegate is outside the scope of a class or interface, but the usage of
a delegate must be in the context of a class. Therefore, while a declaration requires no surrounding
type, the implementation does.
The type of the delegate is the identifier of the method, which in our case is ProcessValue.
The delegate will be used in the code example to provide a general callback mechanism in the
iterator. The iterator is declared as follows:
是什么意思啊?谢谢各位
The class Extensions is a static class that has a static method. As explained in Chapter 4,
this means Extensions can never be instantiated as a type, and to call the method Iterate(),
you need to use the following syntax.
Extensions.Iterate(...);
The first parameter of the Iterate() method is the list to iterate, and the second parameter
is a delegate instance. Notice that the first parameter is declared with the this keyword.
Imagine declaring the method wi

委托的声明是在类或者接口的外部,但是,一个委托的使用必须在一个类的上文有关语境里。因此,在委托声明的时候不需要环境类型,但是在使用(类中(的时候就需要了。
委托的类型由(他委托的)方法所决定,我们所关心就是过程值(使用时的委托的实例。)在下面的代码例子中,这个委托被用来提供一个在迭代中使用的回调方法,迭代的说明如下:

Extensions类是一个有一个静态方法的静态类。就象在第4节讲解的,总金额意味着Extensions类永远不能被实例化;而且,要使用Iterate()方法时,你需要照着下面的语法规则:
Extensions.Iterate(...); 吃饭。。剩下的你应该能翻译了
with the this keyword是用'this'关键字

该宣言是代表范围以外的一类或接口,但使用

代表必须在一类。因此,虽然声明并不需要周边

型,不执行。

该类型的代表是识别的方法,它在我们的案例是ProcessValue 。

该代表将用于代码示例提供一个一般性的回调机制

迭代器。该迭代宣布如下:

是什么意思啊?谢谢各位

扩展类是一个静态类有一个静态方法。正如在第4章

这意味着扩展永远不能实例作为一个类型,并呼吁该方法迭代( ) ,

您需要使用以下语法。

Extensions.Iterate (...);

第一个参数的迭代( )方法的清单,重复,第二个参数

是一个代表实例。请注意,第一个参数是宣布与此关键字。

试想,宣布该方法不使用这一点,并利用该方法为静态方法。

呼叫结构将如下:

1楼去死吧。