| title | How to: Combine Delegates (Multicast Delegates)(C# Programming Guide) | ||
|---|---|---|---|
| ms.date | 07/20/2015 | ||
| ms.prod | .net | ||
| ms.technology |
|
||
| ms.topic | article | ||
| helpviewer_keywords |
|
||
| ms.assetid | 4e689450-6d0c-46de-acfd-f961018ae5dd | ||
| caps.latest.revision | 17 | ||
| author | BillWagner | ||
| ms.author | wiwagn |
This example demonstrates how to create multicast delegates. A useful property of delegate objects is that multiple objects can be assigned to one delegate instance by using the + operator. The multicast delegate contains a list of the assigned delegates. When the multicast delegate is called, it invokes the delegates in the list, in order. Only delegates of the same type can be combined.
The - operator can be used to remove a component delegate from a multicast delegate.
[!code-csharpcsProgGuideDelegates#11]
xref:System.MulticastDelegate
C# Programming Guide
Events