Here is a code for custom events in C#. Note the 3.5 style code that involves Lambda expressions and Anonymous types.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { using TestNamespace; class Program { static void Main(string[] args) { Test t = new Test(); t.TestStarted += (object sender, Test.TestStartedEventArgs e) => { Console.WriteLine("First event handler"); Console.WriteLine(sender.ToString()); Console.WriteLine(e.ToString()); }; t.TestStarted += (object sender, Test.TestStartedEventArgs e) => { Console.WriteLine("Second event handler @ " + e.StartedTime); }; t.DoTest(); Console.ReadLine(); } } } namespace TestNamespace { class Test { public delegate void TestStartedHandler(object sender, TestStartedEventArgs e); public event TestStartedHandler TestStarted; public class TestStartedEventArgs : EventArgs { public string StartedTime { get; set; } } public void DoTest() { if (this.TestStarted != null) { this.TestStarted(this, new TestStartedEventArgs { StartedTime = DateTime.Now.ToString() }); } } } }