Checking for Null Event


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. namespace EventFirer
  2. {
  3. public delegate void DaHandler(string value);
  4.  
  5. public class EventFirer
  6. {
  7. public event DaHandler DaEvent;
  8.  
  9. public void FireEvent(string value)
  10. {
  11. if(DaEvent != null) DaEvent(value);
  12. }
  13.  
  14. }
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.