static void Main(string[] args) { EventExample myEvt = new EventExample(); myEvt.valueChanged += new myEventHandler(myEvt_valueChanged); string str; do{ str = Console.ReadLine(); if(!str.Equals("exit")){ myEvt.Val = str; } }while(!str.Equals("exit")); }
static void Main(string[] args) { EventExample myEvt = new EventExample(); myEvt.valueChanged += new myEventHandler(myEvt_valueChanged); string str; do { str = Console.ReadLine(); if (!str.Equals("exit")) { myEvt.Val = str; } } while (!str.Equals("exit")); }