public static void Main() { EventExample.ListenForEvent(MyEventFunction); EventExample.ListenForEvent(MyEventFunction); EventExample.ListenForEvent(MyEventFunction); EventExample.ListenForEvent(MyOtherEventFunction); EventExample.LaunchEvent(); }
static void Main(string[] args) { EventExample myEvt = new EventExample(); myEvt.valueChanged += new myEventHandler(myEvt_valueChanged); myEvt.Val = "hello"; NumberFunction func = Cube; Console.WriteLine(func(5)); }