O'Reilly logo

Mastering Visual Studio .NET by Jon Flanders, Ian Griffiths, Chris Sells

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Integrating Components with Visual Studio .NET

Visual Studio .NET presents a great deal of information about controls and other components you use in the development environment. When you drag a component from the toolbox into your project, VS.NET appears to know everything about it—the events and properties it supports are displayed in the property panel, neatly categorized, with a short description available for each member. Some controls have their own unique interactive editing features. Many add extra items to Visual Studio .NET’s menus.

You might suspect that this level of extensive and often highly specialized support is something that is available only for the built-in controls, but that is not the case. Visual Studio .NET has a very open architecture for allowing components to customize the way in which they integrate with the environment.

Basic Integration

To build components that exploit Visual Studio .NET’s integration facilities, you must understand the basic mechanisms involved. Component integration relies heavily on the .NET runtime’s reflection mechanism—the facility that allows type information to be examined at runtime. VS.NET uses reflection to discover what properties and events your component provides.

Tip

Strictly speaking, Visual Studio .NET doesn’t use reflection directly. It uses the TypeDescriptor class and its friends in the System.ComponentModel namespace. These provide a virtualized view of type information, which allows a component’s properties ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required