What is Multicast Delegate in C#?
What is Multicast Delegate in C#?
A Multicast Delegate in C# is a delegate that can hold references to multiple handler functions. When the multicast delegate is invoked, it calls all the referenced methods in the order they were added to the delegate.
To create a multicast delegate, you first create two regular unicast delegates (delegates that reference a single method) and combine them using the + operator. This internally calls Delegate.Combine with the two delegates as arguments and returns a new multicast delegate instance.
The behavior of a multicast delegate when invoked is as follows:
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.