Partilhar via


Implementing and Using Automation Extenders

Visual Studio add-ins are deprecated in Visual Studio 2013. You should upgrade your add-ins to VSPackage extensions. For more information about upgrading, see FAQ: Converting Add-ins to VSPackage Extensions.

The Automation Extenders portion of the Visual Studio automation model provides the ability to add or filter properties that are displayed in a specified project type. For example, Visual Studio includes a Visual Basic code model with an object that represents a Visual Basic class.

You can use automation extenders to add new properties to the existing properties in an object. You can also use extenders to filter the properties that display in the project's property page.

You can use an extender to allow users to select a class item in Solution Explorer and modify the code that the wizard creates. You can also use an extender to allow users to place the editor's insertion point inside the class definition and have the Properties window display additional properties of the class.

Warning

The extender manager maintains an internal cache of extender objects, and must be notified when they are being destroyed. You must call NotifyDelete immediately upon destroying extender objects. You must not wait for the application to become idle, because other Visual Studio components may try to access the destroyed extender object before you call the method. If this happens, Visual Studio may crash.

The following are the objects in the Automation Extenders object model.

Automation Extender Interfaces

Description

IExtenderProvider

A specific extender provider.

IExtenderProviderUnk

Any extender provider.

IExtenderSite

The site object that hosts the automation extender.

IFilterProperties interface

When implemented, allows an extender to prevent specified properties from being displayed in the Properties window.

ObjectExtenders

Provides access to automation extenders.

By using these objects, you can:

  • Add properties to objects in Visual Studio, accessible either through the Properties window or through code.

  • Hide properties so that they do not appear in the Properties window.

  • Replace a property with one of the same name, but one that accepts only a specific set of values.

See Also

Tasks

How to: Add and Handle Commands

How to: Create an Add-In

Walkthrough: Creating a Wizard

Concepts

Automation Object Model Chart

Other Resources

Creating and Controlling Environment Windows

Creating Add-ins and Wizards

Automation and Extensibility Reference