Mega Code Archive

 
Categories / VB.Net Tutorial / Class Module
 

Multiple Delegates

Module Module1     Delegate Sub NotifyInfo()     Dim ListOfDelegates(3) As NotifyInfo     Sub Testing()         Console.WriteLine("AAA")     End Sub     Sub Coding()         Console.WriteLine("BBB")     End Sub     Sub Meeting()         Console.WriteLine("CCC")     End Sub     Sub Main()         ListOfDelegates(0) = New NotifyInfo(AddressOf Coding)         ListOfDelegates(1) = New NotifyInfo(AddressOf Testing)         ListOfDelegates(2) = New NotifyInfo(AddressOf Meeting)         Dim NotifyAll As New NotifyInfo(AddressOf Coding)         NotifyAll = NotifyInfo.Combine(ListOfDelegates)         NotifyAll.Invoke()     End Sub End Module BBB AAA CCC