intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Delegates

Chia sẻ: Bui Tuan | Ngày: | Loại File: PDF | Số trang:1

82
lượt xem
11
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

[ Team LiB ] A.6 Delegates The syntax for a delegate in C# closely follows the syntax for a method. The delegate statement is followed by the delegate's return type (or void, if there is none) and the delegate name. This in turn is followed by the delegate's parameter list

Chủ đề:
Lưu

Nội dung Text: Delegates

  1. [ Team LiB ] A.6 Delegates The syntax for a delegate in C# closely follows the syntax for a method. The delegate statement is followed by the delegate's return type (or void, if there is none) and the delegate name. This in turn is followed by the delegate's parameter list, in which each parameter takes the form: For example: public delegate void StateChangeEventHandler(object sender, StateChangeEventArgs e); In a VB Delegate statement, the Delegate keyword is followed by the Sub keyword (if the delegate returns a void in C#) or the Function keyword (if the delegate returns some other value). For example, in VB, the StateChangeEventHandler delegate has the following syntax: Public Delegate Sub StateChangeEventHandler( _ ByVal sender As Object, ByVal e As StateChangeEventArgs) [ Team LiB ]
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2