I want to ask the different between EventHandler
and EventHandler<T>
.
Previously I have implemented a EventHandler
, with a custom EventArgs which can be passed to the parent page from the user control.
I thought I need to apply EventHandler< T >
, however it can be implemented by using EventHandler
. (in fact there is weird error when I trying to apply EventHandler<T>
, the program is worked but error is shown in the IDE which I couldn't solve [C# Custom EventHandler ])
Thus, I want to know in what situation I need to apply EventHandler < T >
?
public event EventHandler AppendProcess;
public event EventHandler<MyEventArg> AppendProcess;
---Update--- this is how I invoke the event in the user control (as i said, i can pass object to parent page by doing this (although i don't know if it is correct to do so)
if (AppendProcess == null) { }
else
AppendProcess(this, new Common.WinLose_ProgressStage(Common.WinLose_SP_Parameter.upper, displayLevel + 1,
(int)Common.WinLose_Level.lvChild4, thename, refundratio,
selfproportion, -1, -1, loadlevel, isPlayer, betsource, gamecategory, false));