Sdílet prostřednictvím


Extend the object model of the base project

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

A project subtype may extend the automation object model of the base project in the following places:

  • Project.Extender("<ProjectSubtypeName>"): This allows a project subtype to offer an object with custom methods from the Project object. A project subtype can use Automation Extenders to expose the Project object. The IInternalExtenderProvider interface implemented on the main project subtype aggregator should offer its object for the VSHPROPID_ExtObjectCATID from __VSSPROPID2 (corresponding to an itemid value of VSITEMID.Root) CATID.

  • ProjectItem.Extender("<ProjectSubtypeName>"): This allows a project subtype to offer an object with custom methods from a particular ProjectItem object within the project. A project subtype can use automation extenders to expose this object. The IInternalExtenderProvider interface implemented on the main project subtype aggregator needs to offer its object for the VSHPROPID_ExtObjectCATID from __VSHPROPID2 (corresponding to a desired VSConstants.VSITEMID) CATID.

  • Project.Properties: This collection exposes the configuration-independent properties of the Project object. For more information on Project properties, see Properties. A project subtype can use Automation Extenders to add its properties to this collection. The IInternalExtenderProvider interface implemented on the main project subtype aggregator needs to offer its object for the VSHPROPID_BrowseObjectCATID from __VSHPROPID2 (corresponding to an itemid value of VSITEMID.Root) CATID.

  • Configuration.Properties: This collection exposes the configuration-dependent properties of the project for a particular configuration (for example, Debug). For more information, see Configuration. A project subtype can use Automation Extenders to add its properties to this collection. The IInternalExtenderProvider interface implemented on the main project subtype aggregator offers its object for the CATID VSHPROPID_CfgBrowseObjectCATID (corresponding to an itemid value of VSITEMID.Root). The IVsCfgBrowseObject interface is used to distinguish one configuration browse object from another.

See also