After the user is done with form "f", the form will retain a value that I want to check before running doStuff(). Like, if f.value > 0 , then run doStuff(), else, don't run doStuff(). How can I most concisely modify my code to allow for this check? I don't quite understand when the delegate is assigned, if I pass f.value, will it take the value when I'm adding the delegate, or when it is running the delegate?
form f = new form();
f.Show();
f.FormClosing += delegate{doStuff();};
Thanks!