>>Hi John,
>>
>>>Hi Tim,
>>>
>>>That event structure you posted is the old method of doing it. .Net 3.5 introduced generic event handlers allowing you to do this (with all of the plumbing wired for you automatically):
>>>
>>>
>>> public event EventHandler<NavBarGroupChangedEventArgs> NavBarGroupChanged;
>>>
>>> /// <summary>
>>> /// Triggers the NavBarGroupChanged event.
>>> /// </summary>
>>> public void RaiseNavBarGroupChanged(string group, string lastGroup, NavBarControl control)
>>> {
>>> var handler = this.NavBarGroupChanged;
>>> if (handler != null)
>>> {
>>> handler(this, new NavBarGroupChangedEventArgs(group, lastGroup, control));
>>> }
>>> }
>>>
>>
>>That is cool, is the delegate the only thing not needed then?
>>Tim
>
>Correct, the delegate and wiring is done behind the scenes from what I understand.
I always thought typing a delegate just to define a signature was silly. Glad to know about this, Thanks!
I also wonder, several books, programmers name the delegate with a handler postfix. I never could grasp this and so I use delegate instead. Now mabey it makes more sense, but still not sure I see the significance of the word. Now the method at the subscriber could be called a handler and it would make sense to me, but that is not the case. Go figure.
Thanks again
Tim
Timothy Bryan