11. Design-Time Integration: The Properties Window
Windows Forms applications are designed and built primarily for a user-driven mode of execution commonly known as the run time. A subset of Windows Forms classes, including components, contr...
Design-Time Components
Before components, controls, and user controls can start using design-time features, they must integrate with the design time itself. As discussed in Chapter 9: Components, the point of integration between a class and the de...
Hosts, Containers, and Sites
In VS05, when a component is dragged onto a Windows Forms design surface, it is instantiated by the Windows Forms Designer, which also grabs a reference to its IComponent interface. At the highest level, the Windows Fo...
Debugging Design-Time Functionality
Because components implement functionality for both run time and design time, you need to test and debug them in both modes. To test run-time functionality, you simply set a breakpoint in your component's code a...
The DesignMode Property
To change the behavior of a component depending on whether it's executing at design time or run time, you need to know that you're running in a designer. This information is provided by Component's DesignMode property, whic...
Attributes
Design-time functionality is available to controls in one of two ways: programmatically or declaratively. Checking the DesignMode property is an example of the programmatic approach. One side effect of using a programmatic approach is t...
Code Serialization
Whereas the DefaultEvent and DefaultProperty attributes affect only the behavior of the Properties window, the DefaultValue attribute serves a dual purpose: It also plays a role in helping the Windows Forms Designer determine wh...
Batch Initialization
As you may have noticed, the code that's eventually serialized to InitializeComponent is laid out as an alphabetically ordered sequence of property sets, grouped by object. Order may become problematic if your component expose...
Extender Property Providers
The discussion to this point has focused on the properties implemented by a component for itself. One example of such a property, TimeZoneModifier, allows AlarmClockControl to be time zone sensitive,
allowing it to dis...
Type Converters
When you select a component on a design surface, the entries in the Properties window are rendered from an internal instance of that component. When you edit properties in the Properties window, the component instance is updated wi...
UI Type Editors
ExpandableObjectConverters help break down a complex multivalue property into a nested list of its atomic values. Although this technique simplifies editing of a complicated property, it may not be suitable for other properties tha...
Where Are We?
Although a component gains a default level of integration with the VS05 design-time environment with no work on your part, .NET gives you a rich supporting infrastructure that can be used to enhance a component's design-time experien...
С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.