July 2015
Intermediate to advanced
1300 pages
87h 27m
English
A delegate can hold a reference (that is, the address) to a method. It is possible to create delegates holding references to more than one method by creating multicast delegates. A multicast delegate is the combination of two or more delegates into a single delegate, providing the delegate the capability to make multiple invocations. The following code demonstrates how to create a multicast delegate, having two instances of the same delegate pointing to two different methods:
'The delegate is defined at namespace levelPublic Delegate Sub WriteTextMessage(ByVal textMessage As String)'....Private textWriter As New WriteTextMessage(AddressOf WriteSomething)Private complexWriter ...