// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; public class Program { public delegate void Del(int a); public static void Test(Del d) { d(123); } public static void Main(string[] args) { int b = 456; Test(delegate(int a) { Console.WriteLine("F1: " + a + " " + b); } ); Test(delegate(int a) { Console.WriteLine("F2: " + a + " " + b); } ); } }