Extending My
One of the most interesting features of the My
namespace is that it is extensible with custom members. You can both extend My
at the root level or extend existing members such as Application
and Computer
. The first goal of this section is to show how you can extend My
at the higher level, implementing functionalities for working with collections, such as a property that allows converting from a generic collection into an ObservableCollection(Of T)
. We need to mimic how Visual Basic 2010 handles the My
namespace, so first add a new module to the project and name it MyCollectionsUtils. Each member you want to be added to My
must start with the My letters; this is the reason for using the MyCollectionsUtils
identifier. The compiler ...
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.