How to add Custom Event? Very easy, just add this code to your class:
// delegate declaration
public
delegate
void
ChangingHandler(
object
sender);
// event declaration
public
event
ChangingHandler OnDoFilter;
// this one is to call event
private
void
FireOnDoFilter(
object
sender)
{
if
(OnDoFilter !=
null
)
{
OnDoFilter(sender);
}
}
Custom Events are easy to create and easy to use. Lets use it!
Hope this helps!
No comments:
Post a Comment
Note: only a member of this blog may post a comment.