I have a very basic question regarding delegate types. I compared the memebers of Delegate and MulticastDelegate classes in object browser and I couldn't find any new additional member present in MulticastDelegate. I also noticed that the Delegate class has GetInvocationList virtual method. So I assume that the Delegate class should have the capability to hold references to multiple methods. If my assumption is correct I wonder why not custom delegate types directly derive from the Delegate class instead of MulticastDelegate class. Not sure what I am missing here. Please help me understand the difference.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Basically the split of
Delegate
andMulticastDelegate
is for historical reasons. Originally there were going to be delegates which couldn't be combined and ones which could... but that turned out not to be a useful distinction. Apparently that was only discovered when it was a bit too late to ripMulticastDelegate
out of the framework/CLR.From CLR via C#, 3rd edition: