1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Delegates doc

1 66 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề A.6 Delegates
Thể loại Bài giảng
Định dạng
Số trang 1
Dung lượng 10,06 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

L 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

Trang 1

L 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:

<parameter_type> <parameter_name>

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 |

Ngày đăng: 21/01/2014, 11:20

TỪ KHÓA LIÊN QUAN

w