Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - Old Dog, Old Trick
A simple programmers blog
 
# Friday, February 24, 2006
I've started working though the Hands-On-Labs for Windows Workflow Foundation today and in Lab 1, Excerise 1 (more about that later) I discovered something old that I had never existed before:  Event Accessors. 
 
Normally you would decalre an event like this:
 

    1 public event EventHandler<CancelEventArgs> ValidateControls;

 

 

Using Event Accessors makes this look a lot more like a property:

 

    1     public event EventHandler<CancelEventArgs> ValidateControls

    2     {

    3       add

    4       {

    5 

    6       }

    7       remove

    8       {

    9 

   10       }

   11     }

 

This could be useful to ... hmmm, I'm not exactly sure if I would use it, but I imagine some people would.

 

FYI, this also works in .Net 1.1.  Not sure about VB though.

Friday, February 24, 2006 8:59:21 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General  | 
Comments are closed.
Copyright © 2012 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: