Danh mục

Delegates

Số trang: 1      Loại file: pdf      Dung lượng: 10.06 KB      Lượt xem: 8      Lượt tải: 0    
Jamona

Xem trước 1 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

[ 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 delegates return type (or void, if there is none) and the delegate name. This in turn is followed by the delegates parameter list
Nội dung trích xuất từ tài liệu:
Delegates[ Team LiB ]A.6 DelegatesThe syntax for a delegate in C# closely follows the syntax for a method. The delegatestatement is followed by the delegates return type (or void, if there is none) and thedelegate name. This in turn is followed by the delegates parameter list, in which eachparameter 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 thedelegate returns a void in C#) or the Function keyword (if the delegate returns some othervalue). For example, in VB, the StateChangeEventHandler delegate has the followingsyntax:Public Delegate Sub StateChangeEventHandler( _ ByVal sender As Object, ByVal e As StateChangeEventArgs)[ Team LiB ]

Tài liệu được xem nhiều: