Wrox Programmer Forums
|
BOOK: Professional Windows Workflow Foundation ISBN: 978-0-470-05386-7
This is the forum to discuss the Wrox book Professional Windows Workflow Foundation by Todd Kitta; ISBN: 9780470053867
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Windows Workflow Foundation ISBN: 978-0-470-05386-7 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2009, 12:01 PM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Best Practices to Declare Events

Hello,
I was reading in the book: Chapter 6, Page: 147 lists the following code:
Code:
public class MyActivity : Activity
{
    public static readonly DependencyProperty SomethingHappenedEvent;
    
    public event EventHandler SomethingHappened
    {
        add
        {
            base.AddHandler(MyActivity.SomethingHappenedEvent, value);
        }
        
        remove
        {
            base.RemoveHandler(MyActivity.SomethingHappendEvent, value);
        }
    }
}
Now, my question: is it a good practice to declare the event with the "readonly" modifier? I did not use to do so my self. Also, I'm using VS'08 with WF 3.5; if I declare a DependencyProperty or a DependencyEvent I use code snippets 'wdp' and 'wde' respectively and the code generated does not include the readonly modifier.

Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
View layer best practices danielpilon C# 0 May 8th, 2008 07:41 AM
Debugging - best practices bonekrusher XSLT 6 March 3rd, 2008 09:13 AM
ObjectDataSource Best Practices? TKelley4591 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 July 20th, 2007 02:39 PM
XSLT Best Practices tripecac XSLT 1 May 4th, 2007 06:02 PM
Design Practices rfurman1161 Access 3 March 24th, 2006 09:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.