Why DynamicInvoke

Topics: Developer Forum, User Forum
Feb 7, 2007 at 2:01 PM
I noticed that DynamicInvoke is used for the custom events. Why use DynamicInvoke, which is a late-bound function? Why not just do something like this:

public event EventHandler<GridViewInsertEventArgs> RowInserting;
protected virtual void OnRowInserting(GridViewInsertEventArgs args)
{

if (this.RowInserting != null)
this.RowInserting(this, args);

}

Code is shorter and it's early bound.