Extending My.Application and My.Computer

Extending existing members such as Application and Computer is straightforward, because both are implemented as partial classes, so you can simply add your own partial classes without the need of editing auto-generated code. Previous considerations remain unchanged, meaning that your partial classes’ names need to start with My (such as MyApplication and MyComputer) and that both must be enclosed within an explicit declaration of a Namespace My..End Namespace code block. For example, imagine you want to extend My.Application with a method that associates a file extension with your application so that each time you double-click a file with that particular extension it will be opened by your application. ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.