1.词汇
- delegate type 委托类型
- delegate instance 委托实例
- derive from 继承自
2.例句
-
A delegate type is effectively a list of parameter types and a return type. It specifies what kind of action can be represented by instances of the type.For instance, consider a delegate type declared like this:
委托类型由参数列表和返回类型构成。它指定了委托实例可以执行什么样的操作。比如,一个委托类型的声明的格式如下:
delegate void StringProcessor(string input);
-
The code says that if you want to create an instance of StringProcessor, you’ll need a method with one parameter (a string) and a void return type.
这段代码是说,如果你要创建一个StringProcessor的实例,你提供的方法中要包含一个字符串参数和返回的类型为void.
-
It’s important to understand that StringProcessor really is a type, deriving from System.MulticastDelegate, which in turn derives from System.Delegate. It has methods, you can create instances of it and pass around references to instances, the whole works.
StringProcessor是一个类型,这一点非常重要,其继承自System.MulticastDelegate,而System.MulticastDelegate又继承自System.Deleagate. 它有方法,你可以创建实例的时候传递引用给实例,这一切都没有问题。