T
tshad
***************************************************
public class UserControl1 : System.Windows.Forms.UserControl {
// ...
public event EventHandler OnClick;
// ...
public void SomeFuncWhichFiresClickEvent() {
// ...
// fire event
if (OnClick != null)
OnClick(this, new EventArgs());
}
// ...
}public class UserControl1 : System.Windows.Forms.UserControl {
// ...
public event EventHandler OnClick;
// ...
public void SomeFuncWhichFiresClickEvent() {
// ...
// fire event
if (OnClick != null)
OnClick(this, new EventArgs());
}
// ...
}
**************************************************
I am curious about the naming of EventHandlers.
Normally you see and event preceeded with the word "On" (OnClick,
OnSelect,...)
In the above, OnClick could be anything, right? It doesn't have to have the
"On" in front of it.
Is this just a convention or is it required?
I would follow this, but I am curious if it has to be that way?
Thanks,
Tom
public class UserControl1 : System.Windows.Forms.UserControl {
// ...
public event EventHandler OnClick;
// ...
public void SomeFuncWhichFiresClickEvent() {
// ...
// fire event
if (OnClick != null)
OnClick(this, new EventArgs());
}
// ...
}public class UserControl1 : System.Windows.Forms.UserControl {
// ...
public event EventHandler OnClick;
// ...
public void SomeFuncWhichFiresClickEvent() {
// ...
// fire event
if (OnClick != null)
OnClick(this, new EventArgs());
}
// ...
}
**************************************************
I am curious about the naming of EventHandlers.
Normally you see and event preceeded with the word "On" (OnClick,
OnSelect,...)
In the above, OnClick could be anything, right? It doesn't have to have the
"On" in front of it.
Is this just a convention or is it required?
I would follow this, but I am curious if it has to be that way?
Thanks,
Tom