static void Main(string[] args) { EventPublisher p = new EventPublisher(); p.MyEvent += new EventPublisher.MyEventHandler(doAction); p.Do(); }