Partilhar via


ProvideToolboxItemsAttribute Constructors

Definition

Overloads

ProvideToolboxItemsAttribute(Int32)

Creates a new instance of ProvideToolboxItemsAttribute which indicates if a class implementing a VSPackage is providing Toolbox items.

ProvideToolboxItemsAttribute(Int32, Boolean)

Initializes a new instance of ProvideToolboxItemsAttribute for the specified version.

ProvideToolboxItemsAttribute(Int32)

Creates a new instance of ProvideToolboxItemsAttribute which indicates if a class implementing a VSPackage is providing Toolbox items.

public:
 ProvideToolboxItemsAttribute(int version);
public:
 ProvideToolboxItemsAttribute(int version);
 ProvideToolboxItemsAttribute(int version);
public ProvideToolboxItemsAttribute (int version);
new Microsoft.VisualStudio.Shell.ProvideToolboxItemsAttribute : int -> Microsoft.VisualStudio.Shell.ProvideToolboxItemsAttribute
Public Sub New (version As Integer)

Parameters

version
Int32

The version of the Toolbox items a VSPackage supplies.

Examples

In the example below the attributes applied to the class MyPackage indicates that it supports version 1 of Toolbox items of with two clipboard formats "CF_XMLCODE" and "InPlaceMenuEditorMenu".

[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0")]  
[ProvideToolboxItems( 1)]  
[ProvideToolboxFormat("CF_XMLCODE")]  
[ProvideToolboxFormat("InPlaceMenuEditorMenu")]  
[Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")]  
internal sealed class MyPackage : Package  

Remarks

Visual Studio tracks the version numbers of Toolbox items provided by a VSPackage. The version number of an item, supplied by the version argument to the constructor, is stored when the VSPackage is registered as a Toolbox item provider.

If the version of the Toolbox items a VSPackage provides does not match the value stored by Visual Studio for that package, Visual Studio issues the ToolboxUpgraded event.

Applies to

ProvideToolboxItemsAttribute(Int32, Boolean)

Initializes a new instance of ProvideToolboxItemsAttribute for the specified version.

public:
 ProvideToolboxItemsAttribute(int version, bool needsCallbackAfterReset);
public:
 ProvideToolboxItemsAttribute(int version, bool needsCallbackAfterReset);
 ProvideToolboxItemsAttribute(int version, bool needsCallbackAfterReset);
public ProvideToolboxItemsAttribute (int version, bool needsCallbackAfterReset);
new Microsoft.VisualStudio.Shell.ProvideToolboxItemsAttribute : int * bool -> Microsoft.VisualStudio.Shell.ProvideToolboxItemsAttribute
Public Sub New (version As Integer, needsCallbackAfterReset As Boolean)

Parameters

version
Int32

The version of the items.

needsCallbackAfterReset
Boolean

If true, then set the registry key that forces a ToolboxInitialized event after each toolbox reset.

Applies to