Compartir a través de


IVsToolboxItemProvider Interface

Implemented by packages that want to provide statically registered toolbox items (on the same object as IVsPackage).

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assemblies:   Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
  Microsoft.VisualStudio.Shell.Interop.10.0 (in Microsoft.VisualStudio.Shell.Interop.10.0.dll)

Syntax

'Declaration
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
<GuidAttribute("F2F94425-E001-4C4D-816C-70202E9A594C")> _
Public Interface IVsToolboxItemProvider
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[GuidAttribute("F2F94425-E001-4C4D-816C-70202E9A594C")]
public interface IVsToolboxItemProvider
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)]
[GuidAttribute(L"F2F94425-E001-4C4D-816C-70202E9A594C")]
public interface class IVsToolboxItemProvider
[<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)>]
[<GuidAttribute("F2F94425-E001-4C4D-816C-70202E9A594C")>]
type IVsToolboxItemProvider =  interface end
public interface IVsToolboxItemProvider

The IVsToolboxItemProvider type exposes the following members.

Methods

  Name Description
Public method GetItemContent Returns a global handle to a user interface item's content.

Top

Remarks

If toolbox content is declared in the registry, this interface is called by the toolbox to retrieve item content on demand (instead of creating it all with a single call to ResetDefaults). If content is declared in the registry but this interface is not implemented, ResetDefaults is still be called, but the call is delayed until a toolbox item's content is needed (for example, when the user drags an item onto a designer).

To declare toolbox content in the registry, create the registry key Toolbox\DefaultContent under HKLM\Software\Microsoft\<appid>\<version>\Packages\<package GUID>.

Under the DefaultContent key, create one key for each toolbox group you want to create or place items in. The name of the key is the "unique ID" (e.g. a non-localized name); the default value of the key is the name. If the name is localizable, you should set the default value to "#123", where 123 is the ID of a resource in your satellite DLL. Under each group key, create one key for each toolbox item you want to add to the group.

The key name and default value are the unique ID and name (same as for group keys). The following values are also required:

  • HelpKeyword : string

  • Formats : a semicolon-delimited list of data format names.

  • Either Bitmap : binary data representing the pixels of an image, with four bytes per pixel(<unused>, red, green, blue) arranged left-to-right and top-to-bottom (as retrieved by the GetDIBits function using DIB_RGB_COLORS, 1 plane, BI_RGB compression, and32 bits per pixel). The bitmap must be 16x16 pixels unless it is an image strip (see BitmapIndex below), in which case it must be 16 pixels high and a multipleof 16 pixels wide.or...BitmapResourceID : a string identifying a bitmap resource in the package's satelliteDLL. The size constraints described for "Bitmap" apply here too.

  • TransparentColor : a DWORD (with bytes <unused>, red, green, blue) indicating the color that should be rendered transparently in the item's bitmap.

  • The following optional values may also be specified:

    1. String values TipTitle, TipVersion, TipPublisher, TipType, and TipDescription (see comments on IVsToolboxDataProvider2::GetItemTipInfo.

    2. String values AssemblyName, TypeName, TFMs, and TargetedItemProvider.

    3. String value MinimumFrameworkVersion is also supported, for compatibility with VS 2008.

    4. DWORD value BitmapIndex, which indicates that the bitmap is actually an image strip and identifies the image to be extracted from it.

Each item key may optionally have a subkey called "ItemContent" containing data formats whose content is known at install time. For each of these, a value is created under this key whose name is the name of the data format and whose value is a binary blob containing the bytes of the format.

The contents of the data formats will be loaded on demand using IVsToolboxItemProvider or ResetDefaults as described above.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace