Section E: Properties, Dynamic Help, and Favorites

I l @ ve RuBoard

Now let's examine what is arguably the most well-used corner of the IDE real estate.

The Property Browser

Almost every aspect of .NET is configured, controlled, and examined through the property system. Objects within .NET have the ability to display their parameters through special attributes that are tied to their properties. If you're familiar with Visual Basic, the property grid will make you feel right at home. If you're a veteran C++ programmer, the property system might take a little getting used to. Figure 1.5.18 shows the Properties pane being used to edit a Windows Form control.

Figure 1.5.18. The Property Browser.

graphics/0105fig18.gif

The Property Browser pane displays a grid of name -value items that can optionally be grouped into categories. Some items might have their own sub-properties. These can be displayed by expanding them using the + icon on the left side. Similarly, whole categories can be expanded and collapsed by using the + or “ icons appropriately. Generally, the property grid deals exclusively with simple values, for example, a number or a string value. However, values that are represented by numbers can sometimes be more easily represented using some other form, for example, a box containing a swatch of color. The Property Browser has the ability to convert certain types of information, say a color value in numeric RGB, to a UI element, such as the color swatch seen in Figure 1.5.18. Furthermore, a simple enum value might be stored internally as its numeric value, but the Property Browser can show the actual mnemonic values. Figure 1.5.18 shows a property called Cursor and the value currently selected is Ibeam .

The Property Browser doesn't just display information in a user -friendly or mnemonic fashion. It also allows you to edit it in a more useful way. The color swatches shown in Figure 1.5.18 can be altered using a specialized color picker that pops up when you try to change the value. Figure 1.5.19 shows the Property Browser editing one of the color values.

Figure 1.5.19. Editing a color value with the Property Browser.

graphics/0105fig19.gif

There are several specialized UI editors for properties of framework objects. The Anchor and Dock properties of a Windows Form control have editors with intuitive, graphical interfaces.

The Property Browser toolbar, just above the main Property Browser, is used to display different types of information or order the data in a different way. Depending on the context of the properties you are viewing, you will see some of the following buttons .

graphics/categorized.gif

Categorized ”Selects a property browser view that shows items grouped into categories, such as Appearance or Behavior.

graphics/alphabetic.gif

Alphabetic ”Sorts all properties into alphabetic order, ignoring the category.

graphics/events.gif

Events ”Lists all the event properties of a component and allows you to create an event handler for them. Events are used in the framework in place of message maps. To create or edit a handler for a particular event, click the event name in the list. The IDE will allow you to type in a name for your handler or select an existing handler from a drop-down list. After a handler has been created or selected, you can double-click it to go to the code. If you want to create a handler with a pre-selected name, simply double-click an event with no handler and the IDE will create one with a name indicative of the object and function to which the handler is assigned.

graphics/messages.gif

Messages ”This button will appear on the toolbar when the Class View pane is displaying a Windows C++ application. You can view, edit, and add message handlers to your C++ classes through the Property Browser. The method of adding message handlers to your C++ classes is similar to that of the Event Editor mentioned earlier.

graphics/overrides.gif

Overrides ”When the Class View is displaying C++ classes you can edit, add, and view overrides for a selected class in the class view by clicking this button on the Property Browser toolbar.

graphics/propertypages.gif

Property pages ”When using the Solution Explorer to look at project or solution configurations, the toolbar of the Property browser will show this button. Use it to display a dialog with the available properties for that configuration.

graphics/properties.gif

Properties ”If you have used the Property Browser to view events or other information, you can switch back to the normal property view with this button.

Dynamic Help

The new dynamic help system in Visual Studio.net makes a big difference to the busy programmer. It's not often now that you need to search the help database as you're programming, because Dynamic Help keeps an updated list of information relevant to what you are typing all the time. It even keeps information about the windows you're using in the IDE. For example, if you select the Dynamic Help tab in section E and then select the Class View, a help item on using the Class View pane will be made available.

Experience has shown, however, that Dynamic Help requires a lot of processing power, because it is searching and collating data almost with every keystroke. There is an option to turn Dynamic Help off, and you might want to consider this if your machine seems sluggish when using VS.NET.

The Favorites Window

Your Internet Favorites list is also available from this section of the IDE. Selecting a favorite link will display it in the browser interface in the main editing pane.

I l @ ve RuBoard


C# and the .NET Framework. The C++ Perspective
C# and the .NET Framework
ISBN: 067232153X
EAN: 2147483647
Year: 2001
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net