I have not tested the scenario with .NET symbols installed, and so I
do not really know exactly what .NET is doing. But being familiar with
similar implementations, I can hypothesize that from the framework's
point of view, the event really does occur three times.
At least two I can figure out off the top of my head: obviously when the
data source is changed, the Current property changes also. But in
addition, probably there is code that kicks in after the data source
changes that explicitly sets the Current property, causing the event to
be raised again.
What the third time is, I do not have a good guess, but it is probably
something similar. Maybe related to a default filtering or sorting that
the class does (that being one of the events the class is documented as
raising the event for).
Of course, one could argue that simply changing the data source
_should not_ result in the event being raised, or that having raised that
event, setting the Current property to the same thing it is already set
to should not raise the event, or that having internally set the Current
property when the data source changes, the code should not need to set
the Current property _again_. And similar arguments can probably be
made for whatever is causing the third instance of the event being raised.
I'd probably even agree with that argument, barring some strong
justification from Microsoft to do otherwise.
But I do not see any way to alter the behavior of the BindingSource class
itself. And there is a pretty good chance Microsoft would disagree with
the above argument, in spite of the awkward behavior. And maybe they'd
even have a decent justification.
Fortunately, it should not be difficult to treat consecutive invocations
of the event handler when the Current property has not really changed,
simply by keeping track of what the property was the last time the event
was raised and comparing it to the current Current value.
In any case, I do recommend submitting a bug on the Connect web site, to
at least see what Microsoft says about it. Maybe they'd even offer a
better work-around than I have.
In the meantime, you can console yourself with the fact that this guy is
seeing the event being raised not three times, but FOUR:
And no one ever replied to his question at all. :(