Share via


ProvideToolboxFormatAttribute.Format Property

Gets the name of a supported clipboard format.

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

Syntax

'Declaration
Public ReadOnly Property Format As String
public string Format { get; }
public:
property String^ Format {
    String^ get ();
}
member Format : string with get
function get Format () : String

Property Value

Type: 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);
                   }
     }

}

.NET Framework Security

See Also

Reference

ProvideToolboxFormatAttribute Class

Microsoft.VisualStudio.Shell Namespace

ProvideToolboxFormatAttribute

ProvideToolboxItemsAttribute

ProvideToolboxFormatAttribute

Other Resources

Toolbox (Visual Studio SDK)