class Program { static void Main() { EventHandler handler; handler = delegate { Console.WriteLine("Handled anonymously"); }; handler(null, EventArgs.Empty); Console.ReadKey(); } }