IVsExpansionClient::GetExpansionFunction Method (IXMLDOMNode^, String^, IVsExpansionFunction^)
Called to obtain an expansion function for the specified code snippet.
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)
int GetExpansionFunction(
IXMLDOMNode^ xmlFunctionNode,
String^ bstrFieldName,
[OutAttribute] IVsExpansionFunction^% pFunc
)
Parameters
- xmlFunctionNode
-
Type:
MSXML::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).
- pFunc
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsExpansionFunction^
[out] Returns an IVsExpansionFunction object representing the expansion function to use.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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 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. 572c5549-5821-4e15-8ecd-0fa86c1c65df