Quick question; Is it always necessary to check the zero value after performing a safe throw? I am doing it like this now, but in this situation:
void button1_Click(object sender, EventArgs e) { Button = sender as Button; if (button != null)
I'm just wondering if I'm thinking about something. I check the null value every time out of habit, but in that case, I think I would prefer to crash if a non-Button object was connected to a handler, which should only be for buttons.
EDIT: Alright, thanks guys. I was just curious if there was a corner that I was missing.
source share