Condividi tramite


IVsExpansionManager.GetTokenPath Method

Returns the path to the specified location.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Syntax

'Declaration
Function GetTokenPath ( _
    token As UInteger, _
    <OutAttribute> ByRef pbstrPath As String _
) As Integer
int GetTokenPath(
    uint token,
    out string pbstrPath
)
int GetTokenPath(
    [InAttribute] unsigned int token, 
    [OutAttribute] String^% pbstrPath
)
abstract GetTokenPath : 
        token:uint32 * 
        pbstrPath:string byref -> int
function GetTokenPath(
    token : uint, 
    pbstrPath : String
) : int

Parameters

  • pbstrPath
    Type: System.String%

    [out] Returns a string containing the full path to the specified location.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr2.idl:

HRESULT IVsExpansionManager::GetTokenPath(
   [in]ExpansionToken,
   [out] BSTR *pbstrPath
);

Snippets are typically stored in several locations including the location where the associated language service is installed or a folder in the user's My Documents folder. Snippets can also be associated with a specific project or project item and stored in a folder relative to that project or project item.

The paths returned from this method are not to the snippets folder but to the base folder. For example, specifying a token value of ET_MyDocs may return a path such as "C:\Documents and Settings\[username]\My Documents\Visual Studio 2005". The snippets are stored under that path in "Code Snippets\[languagename]\My Code Snippets", where [languageName] is the name of the language such as "C#".

.NET Framework Security

See Also

Reference

IVsExpansionManager Interface

Microsoft.VisualStudio.TextManager.Interop Namespace