Properties and Methods Extended by Project Subtypes

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Properties and Methods Extended by Project Subtypes.

A project subtype has a lot of power to influence the behavior of the project because it is constructed as an aggregator of a base project. This section summarizes some of the features that can be enhanced or modified by project subtypes.

The following table summarizes many of the methods that aggregation enables project subtypes to override in base projects.

Methods Overridden by AggregationProject Subtype
From IVsHierarchy:

 GetProperty

 SetProperty

 GetGuidProperty

 SetGuidProperty
Enables a project subtype to

- Change caption and icon of project node.
- Completely override project Browse object.
- Control whether project can be renamed.
- Control sort order.
- Control user context for dynamic help.
From IVsProject:

 GetItemContext
Enables a project subtype to control what contextual services are provided to designers and editors.
From IOleCommandTarget:

 QueryStatus

 Exec

 QueryStatusCommand

 ExecCommand
Enables a project subtype to

- Participate in the command routing for project commands.
- Add, remove, or disable both project ambient commands and Solution Explorer active commands.
IVsFilterAddProjectItemDlg2Enables the project subtype to filter what the user sees in the Add New Item dialog box.
IVsSingleFileGeneratorFactoryEnables a project subtype to

- Determine the default generator given a file extension.
- Map a human readable generator name to a COM object.

The environment and base project system can use the properties from __VSSPROPID and __VSSPROPID2 enumerations detailed in the following table to enable a project subtype to control various features of the project system.

VSHPROPID propertyProject Subtype
AddItemTemplatesGuidAllows a project subtype to control the contents of the Add Item dialog box. The project subtype can provide a new specification of template directories, add new kinds of items, remove existing items, and reorganize a subset of the items in the base project's Add Item dialog box.
PropertyPagesCLSIDListAllows a project subtype to add or remove configuration-independent property pages.
CfgPropertyPagesCLSIDListAllows a project subtype to add or remove configuration-dependent property pages.
ExtObjectCATIDAllows a project subtype to provide an Automation Extender for the project or project item objects by knowing the Extender CATID. For example, a project subtype can provide a custom Project.Extender("<subtype>") object.
BrowseObjectCATIDAllows a project subtype to provide an Automation Extender for the Browse object by knowing the Extender CATID. For example, a project subtype can add extra properties to the Properties collection.
CfgBrowseObjectCATIDAllows a project subtype to provide an Automation Extender for the project configuration browse object. For example, a project subtype can add extra properties to the Properties collection.
CfgExtObjectCATIDAllows a project subtype to provide an Automation Extender for the configuration object.
DefaultPlatformNameAllows a project subtype to determine the platform name for the project's configuration objects.

The base project provides a default implementation of the above properties. The base project gets these by calling QueryInterface for IVsHierarchy on the outermost project subtype, thus allowing the project subtype to override the implementation of the properties.

Project Subtypes Design

Show: