Delegate chỉ có thể gọi một tham chiếu phương thức đã được đóng gói vào delegate. Một số delegate có thể giữ và gọi nhiều phương thức. Delegate như vậy được gọi là Multicast Delegate. Multicast Delegate (còn được gọi là Combinable Delegate) phải đáp ứng các điều kiện sau:
Trên thực tế, tất cả các delegate trong C# là Multicast Delegate, ngay cả khi chúng chỉ có một phương thức duy nhất. Ngay cả các hàm anonymous và lambdas cũng là Multicast Delegate mặc dù theo định nghĩa, chúng chỉ có một mục tiêu duy nhất.
public partial class MainPage : PhoneApplicationPage
{
public delegate void MyDelegate(int a, int b);
// Constructor
public MainPage()
{
InitializeComponent();
// Multicast delegate
MyDelegate myDel = new MyDelegate(AddNumbers);
myDel += new MyDelegate(MultiplyNumbers);
myDel(10, 20);
}
public void AddNumbers(int x, int y)
{
int sum = x + y;
MessageBox.Show(sum.ToString());
}
public void MultiplyNumbers(int x, int y)
{
int mul = x * y;
MessageBox.Show(mul.ToString());
}
}