次の方法で共有


ExpansionProvider.GetExpansionFunction Method (XmlElement, String)

Returns an IVsExpansionFunction object representing the expansion function described in the given XML template node.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'宣言
Public Overridable Function GetExpansionFunction ( _
    xmlFunctionNode As XmlElement, _
    fieldName As String _
) As IVsExpansionFunction
public virtual IVsExpansionFunction GetExpansionFunction(
    XmlElement xmlFunctionNode,
    string fieldName
)

Parameters

  • 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.

Remarks

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 nulla null reference (Nothing in Visual Basic). The base method assumes the expansion function is defined according to the code snippet schema (as described specifically in the Function Element (IntelliSense Code Snippets) reference).

.NET Framework Security

See Also

Reference

ExpansionProvider Class

GetExpansionFunction Overload

Microsoft.VisualStudio.Package Namespace