Export (0) Print
Expand All

ProvideToolboxFormatAttribute Class

Apply this attribute to classes implementing VSPackages to declare that the VSPackage provides Toolbox items with the specified clipboard format and to enable drag-and-drop support in the Visual StudioToolbox.

Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell (in microsoft.visualstudio.shell.dll)

[AttributeUsageAttribute(AttributeTargets.Class, Inherited=true, AllowMultiple=true)] 
public sealed class ProvideToolboxFormatAttribute : Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class, Inherited=true, AllowMultiple=true) */ 
public final class ProvideToolboxFormatAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class, Inherited=true, AllowMultiple=true) 
public final class ProvideToolboxFormatAttribute extends Attribute

Attribute Context

Applies to

Classes providing VSPackages by implementing the IVsPackage interface or the Package interface.

Repeatable

Yes

Required attributes

ProvideToolboxItemsAttribute

Invalid attributes

None

This attribute is used only for registration purposes and does not affect runtime behavior.

Apply this attribute to classes implementing a VSPackage that either provides Toolbox items with a non-standard clipboard format or does not support one or more the default Toolbox clipboard formats.

A VSPackage without this attribute must support all default Toolbox clipboard types.

For a list of the default Toolbox clipboard types supported by a VSPackage, see Toolbox (Visual Studio SDK).

Use of this attribute by itself does not register a VSPackage as a provider of items with a given clipboard. An instance of the attribute must be applied to register the VSPackage as providing objects of the specified format.

Only one clipboard format is registered as supported for each instance of this attribute applied to a class. To indicate that multiple formats are supported, multiple instances of the attribute must be applied to the class.

Note   C# automatically appends the word "Attribute" to the name of any attribute class. In C# code, refer to this attribute as ProvideToolboxFormat.

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

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

System.Object
   System.Attribute
    Microsoft.VisualStudio.Shell.ProvideToolboxFormatAttribute

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft