ProvideToolboxFormatAttribute.Format Property

Gets the name of a supported clipboard format.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)

Syntax

'宣言
Public ReadOnly Property Format As String
'使用
Dim instance As ProvideToolboxFormatAttribute
Dim value As String

value = instance.Format
public string Format { get; }
public:
property String^ Format {
    String^ get ();
}
public function get Format () : String

Property Value

Type: System.String

The name of the clipboard format.

Remarks

This property is set in the constructor. It must be applied together with the ProvideToolboxItemsAttribute attribute to register a VSPackage's support for specific clipboard formats.

Examples

In the example below, a list of the ProvideToolboxFormatAttribute attributes applied to the VSPackage is obtained and the format values are written to standard output.

public  void PrintFormats(RegistrationContext context) {
    foreach(ProvideToolboxFormatAttribute pfa in 
            context.ComponentType.GetCustomAttributes(typeof(ProvideToolboxFormatAttribute), true)) {
                if (format.Length != 0) {
                    System.Console.WriteLine(pfa.Format);
                   }
     }

}

Permissions

See Also

Concepts

Toolbox (Visual Studio SDK)

Reference

ProvideToolboxFormatAttribute Class

ProvideToolboxFormatAttribute Members

Microsoft.VisualStudio.Shell Namespace

ProvideToolboxFormatAttribute

ProvideToolboxItemsAttribute

ProvideToolboxFormatAttribute