Events Exist Check?

  • Thread starter Thread starter localhost
  • Start date Start date
L

localhost

I have a DataTable that sometimes has the RowChanged event wired up.

Later in code, how can I determine if the DataTable has had the
RowChanged event added already - I don't want to add it twice.

Thanks.
 
You can use Delegate.GetInvocationList() method to get the list of already
attached event handlers. If the count is greater than zero then an event
handler has already been attached.
 
Back
Top