0

I have a bit of confusion regarding static Combine( ) provided in System.Delegate( )

This method returns a System.Delegate type and its purpose is to combine invocation lists of multiple delegates.

But if a delegate is supposed to refer to a single method, and a multicast delegate is supposed to hold reference to multiple methods, then how is the return type of Combine justified as just a System.Delegate?

I think I am missing something here.

Can someone please help.

Thanks.

Jake
  • 16,329
  • 50
  • 126
  • 202
  • Dupe: [why-delegate-types-are-derived-from-multicastdelegate-class-why-not-it-directly](http://stackoverflow.com/questions/4833053/why-delegate-types-are-derived-from-multicastdelegate-class-why-not-it-directly) – nawfal Jul 07 '14 at 18:59

3 Answers3

1

All delegates have the capability of being multicast. Consider Delegate.GetInvocationList.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
0

This is a bit of a shot in the dark, but Multicast Delegates inherit from Delegates... so while it returns an object that is of the Type Delegate, you may be able to cast it to a multicast delegate....

therealmitchconnors
  • 2,732
  • 1
  • 18
  • 36
-1

System.Delegate is abstract, so there is never an instance of System.Delegate returned, just instances of concrete types () derived from System.MulticastDelegate. To my knowledge there is no type that is a Delegate that can only hold a reference to one method.

Hope this helps.

Ani
  • 10,826
  • 3
  • 27
  • 46