using System.Collections.Generic;
public delegate T MeDelegate<T>();
public static void Main(){
public static void TestGetAllReturnValue()
MeDelegate<int> dele = ReturnFive;
foreach (int n in GetAllReturnValue(dele)){
public static void TestGetAllReturnValueWithFunc()
Func<int> dele = ReturnFive;
foreach (int n in GetAllReturnValue(dele)){
static IEnumerable<Targ> GetAllReturnValue<Targ>(Func<Targ> d){
foreach(MeDelegate<Targ> del in d.GetInvocationList())
static IEnumerable<Targ> GetAllReturnValue<Targ>(MeDelegate<Targ> d){
foreach(MeDelegate<Targ> del in d.GetInvocationList())
static int ReturnFive(){return 5;}
static int Return10(){return 10;}
static int Return22(){return 22;}