- Generally, how shall I use the built-in generic delegate
EventHandler<TEventArgs>provided by the .NET Framework? Specifically, I saw an example
Class MyEvent{ ... public event EventHandler<MyEventArgs> SomeEvent; ... } Class EventDemo{ ... void MyEventHandler(Object sender, MyEventArgs e){ ... } ... myEvent = new MyEvent(); myEvent.SomeEvent += new EventHandler<MyEventArgs>(MyEventHandler); }Can
myEvent.SomeEvent += new EventHandler<MyEventArgs>(MyEventHandler);be replaced by
myEvent.SomeEvent += MyEventHandler;In particular, does
new EventHandler<MyEventArgs>()try to convert the functionMyEventHandlerfrom one type to another type?
Thanks.