Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Delegates and Events pot
Nội dung xem thử
Mô tả chi tiết
Delegates and
Events
Chapter 12
Classes are reference types that allow you to create
instances of objects and use them in special ways to
meet your application’s requirement. Another
reference type in C# is delegate. Delegates allow
you to change the reference to a method at runtime.
This means that you can decide the execution of a
method at run-time, based on the requirements of
your application.
The method can be activated at the occurrence of an
event, where an event is associated with the delegate
to call the method at run-time.
This chapter discusses the creation of delegates.
This chapter also discusses how to implement
multicast delegates. In addition, it discusses how
you can use events with delegates.
In this chapter, you will learn to:
Implement delegates
Implement multicast delegates
Use events with delegates
Objectives