Chapter 13. The My Reference


Chapter 13. The 'My' Reference

The My Namespace feature is one of many productivity enhancements introduced with Visual Basic 2005 that bring additional ease of use to .NET. It collects many of the commonly used features of the existing Framework Class Library and bundles them into an ordered hierarchy, simplifying the syntax of those features where possible. More than just a quick lookup or a list of shortcuts, My takes many complex Framework classes and simplifies them for VB programmers.

This chapter includes a reference entry for each member of the My Namespace hierarchy. Each entry includes the following descriptive components:


Location

Identifies the position of the entry within the My hierarchy.


Syntax

Demonstrates the basic usage and syntax of the entry, with descriptions for all programmer-supplied values.


Description

Provides general information on the entry and its use.


Public Members

For entries that represent entire objects, this component identifies some or all of the more useful public members of that object. Some objects have separate entries in this chapter for each member within the object.


Usage at a Glance

Identifies issues that may impact the use of this entry in your source code.


Example

Many entries include a short example that demonstrates common usage for the entry.


Related Framework Entries

Most of the entries in the My hierarchy are derived from other parts of the Framework Class Library. This component identifies those root sources and additional library features that provide identical or related functionality.


See Also

Identifies related elements in the My hierarchy that are also defined in this chapter.

The My Namespace feature includes many hierarchy branches. Some branches, and also some members within each branch, are only available for use in certain types of applications. For instance, the My.Response object is only available in ASP.NET applications. Other members provide different types of functionality, depending on the project type. All of these limitations are discussed within each entry.

Some entries are only valid in Windows Forms applications, specifically those Windows forms applications that have the "application framework" enabled. This feature, introduced in Visual Basic 2005, provides a simplified method of starting up and ending Windows Forms applications, at least from the point of view of the source code. These features are enabled through the project's Application Properties panel. To access the project's properties, select the Properties command in Visual Studio's Project menu or double-click on the My Project entry in Visual Studio's Solution Explorer. On this panel, use the Enable application framework field to toggle the use of this feature.

Some members within the My hierarchy are more commonly used than others. Some of the less commonly used features are hidden from Visual Studio's IntelliSense feature by default. To view these entries, select the All tab from the IntelliSense listing that appears while typing the entry's parent in your source code.

Some features within the My hierarchy may be limited for use by the current set of security permissions in effect for the active user, application, or thread of execution. Permissions are found in the System.Security.Permissions namespace.

See Appendix B for a hierarchical listing of all entries discussed in this chapter.




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

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