I have a function to be executed under a radio button checked event, but it has to be done only once. In subsequent radio button checked events, my function shouldn’t be called.
void rb_CheckedChanged(x, y)
{
LoadSomeData(); //need to load only once.
// rest of the code; to be executed every single time..
}
Note:
-
I want
LoadSomeData()to be executed only under radio button event. -
I can set an integer member variable, and do count++, n check if == 1 etc. Or a boolean flag. That’s not what I’m looking for.
Thanks..
What you can do is create a list of function names that you would like to call in your event, then get the method name from list, using reflection call the method you are interested in and then remove that method name from the list… Next time, when the event is called again, the method won’t be executed before it won’t be in the list.. something like:
then
You can get information about dynamic method invoking from: http://www.codeproject.com/KB/cs/CallMethodNameInString.aspx