Compartilhar via


IVsExpansionClient.GetExpansionFunction Method

Called to obtain an expansion function for the specified code snippet.

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

Syntax

'Declaration
Function GetExpansionFunction ( _
    xmlFunctionNode As IXMLDOMNode, _
    bstrFieldName As String, _
    <OutAttribute> ByRef pFunc As IVsExpansionFunction _
) As Integer
int GetExpansionFunction(
    IXMLDOMNode xmlFunctionNode,
    string bstrFieldName,
    out IVsExpansionFunction pFunc
)
int GetExpansionFunction(
    [InAttribute] IXMLDOMNode^ xmlFunctionNode, 
    [InAttribute] String^ bstrFieldName, 
    [OutAttribute] IVsExpansionFunction^% pFunc
)
abstract GetExpansionFunction : 
        xmlFunctionNode:IXMLDOMNode * 
        bstrFieldName:string * 
        pFunc:IVsExpansionFunction byref -> int
function GetExpansionFunction(
    xmlFunctionNode : IXMLDOMNode, 
    bstrFieldName : String, 
    pFunc : IVsExpansionFunction
) : int

Parameters

  • xmlFunctionNode
    Type: IXMLDOMNode

    [in] An IXMLDOMNode object that contains the code snippet expansion function definition.

  • bstrFieldName
    Type: System.String

    [in] A string containing the name of the default field (the code snippet field that is first highlighted after the code snippet is inserted).

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 IVsExpansionClient::GetExpansionFunction(
   [in]IXMLDOMNode* xmlFunctionNode,
   [in] BSTR bstrFieldName,
   [out] IVsExpansionFunction **pFunc
);

A code snippet can specify the name of an expansion function that is "called" to supply a value that is displayed in a code snippet field. This expansion function is represented by the IVsExpansionFunction interface and calling the expansion function means calling the GetCurrentValue method on that interface.

The XML node contains the code snippet's expansion function tag (see Function Element (IntelliSense Code Snippets) for details). It is up to the implementation of the GetExpansionFunction method to parse the expansion function text for its name and any parameters it may require.

.NET Framework Security

See Also

Reference

IVsExpansionClient Interface

Microsoft.VisualStudio.TextManager.Interop Namespace