How are return values from a delegate handled?

Q: How are multiple return values from a delegate handled?

In C#, it’s possible to write a delegate such as:

delegate double GetResult(params double p);

If there is more than one method on this delegate, there are multiple return values.

A: In this situation, the return value is the value that is returned from the last delegate.

If you want more control on this, you can call GetInvocationList() on the delegate, which will allow you to call each method individually, and process the double values appropriately.

[Author: Eric Gunnerson]