次の方法で共有


Package.ParseToolboxResource Method (TextReader, Guid)

Parses an embedded text resource of appropriate format for information about which items should be added to the Toolbox.

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

Syntax

'宣言
Protected Sub ParseToolboxResource ( _
    resourceData As TextReader, _
    packageGuid As Guid _
)
'使用
Dim resourceData As TextReader
Dim packageGuid As Guid

Me.ParseToolboxResource(resourceData, _
    packageGuid)
protected void ParseToolboxResource(
    TextReader resourceData,
    Guid packageGuid
)
protected:
void ParseToolboxResource(
    TextReader^ resourceData, 
    Guid packageGuid
)
protected function ParseToolboxResource(
    resourceData : TextReader, 
    packageGuid : Guid
)

Parameters

  • resourceData
    Type: System.IO.TextReader

    A text reader that provides toolbox item data in the format described in Remarks.

  • packageGuid
    Type: System.Guid

    The GUID of the VSPackage.

Remarks

The text resource that a VSPackage parses using ParseToolboxResource must be embedded in an assembly and name space accessible to the VSPackage.

Text resources should be added to an assembly by right-clicking on the assembly's project, selection Add and the New Item. From the New Item menu, then select Text File. Once the text file has been added to the project, set its Build Action property to Embedded Resource.

This method can be used to add items to the toolbox automatically. The resource data is passed in through the resourceData parameter and consists of a text file with the following format:

; Comment
[CategoryName]
<class name>, <assembly name>

These resources will not be localized.

Permissions

See Also

Reference

Package Class

Package Members

ParseToolboxResource Overload

Microsoft.VisualStudio.Shell Namespace