C#英语笔记Day 43

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. 它有方法,你可以创建实例的时候传递引用给实例,这一切都没有问题。

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容