In my last entry, I talked about how I loved extending My.Application in VB to create global methods available to my entire application. A reader mentioned that you can get much of the default functionality associated with the My class by using That. But what about adding your own global functionality?
You can easily create your own My.Application in a C# Windows Forms app. This provides a central location for application logging and other common tasks. In the following example, I describe how to do this to expose the DataDirectory property I wrote in a previous post, so that any form or class in your Windows Forms application can discover where the data directory for ClickOnce resides.