Anonymous methods can be assigned a signature
using System;
using System.Threading;
public delegate int DelegateClass(out int param);
public class Starter {
public static void Main() {
int var;
DelegateClass del = delegate(out int inner) {
inner = 12;
Console.WriteLine("Running anonymous method");
return inner;
};
del(out var);
Console.WriteLine("Var is {0}", var);
}
}
Related examples in the same category