MultiCastDelegate vs Delegate

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The documentation for the Delegate and the MultiCastDelegate classes tell me
that when we have a line like:

public delegate void CheckAndPrintDelegate(string str);

it causes the compiler to generate a new delegate class named
CheckAndPrintDelegate that inherits from System.MulticastDelegate.

Elsewhere it says a the same delegate definition produces a delegate class
inheriting from System.Delegate.

Under what condition does this construct create an instance of
System.Delegate and under what condition does it create an instance of
System.MulticastDelegate?

Thanks

Nima Dilmaghani
 
it causes the compiler to generate a new delegate class named
CheckAndPrintDelegate that inherits from System.MulticastDelegate.

Elsewhere it says a the same delegate definition produces a delegate class
inheriting from System.Delegate.

Well the delegate's immediate base class is MulticastDelegate, but
that in turn inherits from Delegate so you could argue that both
statements are true.



Mattias
 
Back
Top