event


Snippet Details

Shortcut
event
Description
Code snippet for event declaration and method for raising it
Language
csharp
Types
Expansion
Author
Fons Sonnemans
Upload on
10/25/2013 1:56:45 PM
Downloads
933

Declarations

ID ToolTip Default
eventname Event name, either NounVerbing or Verbing for pre-events, or NounVerbed or Verbed for post-events NounVerbed

Code Output

        public event EventHandler $eventname$;
 
        protected virtual void On$eventname$()
        {
            var handler = $eventname$;
            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }
    

Download Add to .VSIX Package


comments powered by Disqus

Extension Package

No snippets are added


Languages