(conditional) Multiple Event Handlers C#

Posted by gjk on Stack Overflow See other posts from Stack Overflow or by gjk
Published on 2010-06-09T20:24:54Z Indexed on 2010/06/09 20:32 UTC
Read the original article Hit count: 129

Filed under:
|

A portion of my program requires a "flag" retrieval, that is I am fetching a value that is either True or False, and based on this return value two things could follow.

1) The flag is true, aka "go ahead", and I retrieve data from a database.

2) The flag is false, and I want to prevent the data from being retrieved.

Now, this check has to be performed before any function that would call upon the database in question. I decided to implement this check in the form of an event handler attached to GUI objects that would trigger this data inquiry.

This check event handler is called first upon necessary events, and my question is:

How do I stop subsequent event handlers from firing if the FIRST event handler (my flag checker) comes up FALSE?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about event-handling