G
Guest
Is there any method I can use to determine the number of subscribers to a
controls events.
In particular I'm looking at the ComboBox.SelectedIndexChanged event, I have
a scenario where I need to cancel the SelectedIndexChanged event and restore
the original SelectedIndex property. To do this I unsubscribe the
SelectedIndexChanged event, update the SelectedIndex property and then
re-subscribe. I need to do this to prevent the SelectedIndexChanged event
from firing twice (i.e once when the user changes the control and twice when
the code restores the original value).
I don't want to maintain a flag as the entire user interface is generated
dynamically.
Therefore I need a method to check how many subscribers there are to the
SelectedIndexChanged event before I attempt to add another subscription.
Any ideas would be appreciated.
Steve
controls events.
In particular I'm looking at the ComboBox.SelectedIndexChanged event, I have
a scenario where I need to cancel the SelectedIndexChanged event and restore
the original SelectedIndex property. To do this I unsubscribe the
SelectedIndexChanged event, update the SelectedIndex property and then
re-subscribe. I need to do this to prevent the SelectedIndexChanged event
from firing twice (i.e once when the user changes the control and twice when
the code restores the original value).
I don't want to maintain a flag as the entire user interface is generated
dynamically.
Therefore I need a method to check how many subscribers there are to the
SelectedIndexChanged event before I attempt to add another subscription.
Any ideas would be appreciated.
Steve