ExpansionProvider::GetExpansionFunction Method (XmlElement^, String^)
Returns an IVsExpansionFunction object representing the expansion function described in the given XML template node.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
public: virtual IVsExpansionFunction^ GetExpansionFunction( XmlElement^ xmlFunctionNode, String^ fieldName )
Parameters
- xmlFunctionNode
-
Type:
System.Xml::XmlElement^
[in] An XmlElement object representing the expansion function definition.
- fieldName
-
Type:
System::String^
[in] The name of the variable or field this expansion function represents.
Return Value
Type: Microsoft.VisualStudio.TextManager.Interop::IVsExpansionFunction^If successful, returns an IVsExpansionFunction object; otherwise, returns a null value indicating no expansion function was found in the specified XML node.
This method is called from Visual Studio while parsing a code snippet template file.
The base method parses any arguments from the text contained in the expansion function XML template node and then calls the CreateExpansionFunction method in the LanguageService class to create an ExpansionFunction object. The field name and argument list are set in the ExpansionFunction object and the object is returned as an IVsExpansionFunction object. If there was any problem parsing the expansion function, the base method returns null. The base method assumes the expansion function is defined according to the code snippet schema (as described specifically in the reference).572c5549-5821-4e15-8ecd-0fa86c1c65df