Share via


IVsExpansionClient.GetExpansionFunction Method

Definition

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

public:
 int GetExpansionFunction(MSXML::IXMLDOMNode ^ xmlFunctionNode, System::String ^ bstrFieldName, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::IVsExpansionFunction ^ % pFunc);
public:
 int GetExpansionFunction(MSXML::IXMLDOMNode ^ xmlFunctionNode, Platform::String ^ bstrFieldName, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::IVsExpansionFunction ^ &  pFunc);
int GetExpansionFunction(MSXML::IXMLDOMNode const & xmlFunctionNode, std::wstring const & bstrFieldName, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::IVsExpansionFunction const & & pFunc);
public int GetExpansionFunction (MSXML.IXMLDOMNode xmlFunctionNode, string bstrFieldName, out Microsoft.VisualStudio.TextManager.Interop.IVsExpansionFunction pFunc);
abstract member GetExpansionFunction : MSXML.IXMLDOMNode * string * IVsExpansionFunction -> int
Public Function GetExpansionFunction (xmlFunctionNode As IXMLDOMNode, bstrFieldName As String, ByRef pFunc As IVsExpansionFunction) As Integer

Parameters

xmlFunctionNode
IXMLDOMNode

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

bstrFieldName
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).

pFunc
IVsExpansionFunction

[out] Returns an IVsExpansionFunction object representing the expansion function to use.

Returns

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.

Applies to