in C Sharp by
Q:
Define Multicast Delegate in C#?

1 Answer

0 votes
by
A delegate with multiple handlers are called as multicast delegate. The example to demonstrate the same is given below

public delegate void CalculateMyNumbers(int x, int y);

int x = 6;

int y = 7;

CalculateMyNumbers addMyNumbers = new CalculateMyNumbers(FuncForAddingNumbers);

CalculateMyNumbers multiplyMyNumbers = new CalculateMyNumbers(FuncForMultiplyingNumbers);

CalculateMyNumbers multiCast = (CalculateMyNumbers)Delegate.Combine (addMyNumbers, multiplyMyNumbers);

multiCast.Invoke(a,b);

Related questions

0 votes
0 votes
asked Mar 5, 2020 in C Sharp by JackTerrance
0 votes
asked Jun 16, 2020 in C Sharp by Hodge
...