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.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Syntax
‘선언
Public Overridable Function GetExpansionFunction ( _
xmlFunctionNode As XmlElement, _
fieldName As String _
) As IVsExpansionFunction
‘사용 방법
Dim instance As ExpansionProvider
Dim xmlFunctionNode As XmlElement
Dim fieldName As String
Dim returnValue As IVsExpansionFunction
returnValue = instance.GetExpansionFunction(xmlFunctionNode, _
fieldName)
public virtual IVsExpansionFunction GetExpansionFunction(
XmlElement xmlFunctionNode,
string fieldName
)
public:
virtual IVsExpansionFunction^ GetExpansionFunction(
XmlElement^ xmlFunctionNode,
String^ fieldName
)
abstract GetExpansionFunction :
xmlFunctionNode:XmlElement *
fieldName:string -> IVsExpansionFunction
override GetExpansionFunction :
xmlFunctionNode:XmlElement *
fieldName:string -> IVsExpansionFunction
public function GetExpansionFunction(
xmlFunctionNode : XmlElement,
fieldName : String
) : IVsExpansionFunction
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.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.