Metodo ExpansionProvider.GetExpansionFunction (IXMLDOMNode, String, IVsExpansionFunction%)
Restituisce un oggetto IVsExpansionFunction oggetto che rappresenta la funzione di espansione descritta nel nodo specificato del modello XML (implementazione COM).
Spazio dei nomi: Microsoft.VisualStudio.Package
Assembly: 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)
Sintassi
'Dichiarazione
Public Overridable Function GetExpansionFunction ( _
xmlFunctionNode As IXMLDOMNode, _
fieldName As String, _
<OutAttribute> ByRef func As IVsExpansionFunction _
) As Integer
public virtual int GetExpansionFunction(
IXMLDOMNode xmlFunctionNode,
string fieldName,
out IVsExpansionFunction func
)
Parametri
- xmlFunctionNode
Tipo: IXMLDOMNode
[in] Un oggetto di IXMLDOMNode che rappresenta la descrizione della funzione di espansione.
- fieldName
Tipo: System.String
[in] Il nome della variabile o sistema questa funzione di espansione rappresenta.
- func
Tipo: Microsoft.VisualStudio.TextManager.Interop.IVsExpansionFunction%
[out] restituisce IVsExpansionFunction oggetto che rappresenta l'implementazione delle funzioni di espansione.
Valore restituito
Tipo: System.Int32
Se l'operazione riesce, restituisce S_OK; in caso contrario, restituisce un codice di errore.
Implementa
IVsExpansionClient.GetExpansionFunction(IXMLDOMNode, String, IVsExpansionFunction%)
Note
Questo metodo è un'implementazione di GetExpansionFunction metodo su IVsExpansionClient interfaccia.
il metodo di base converte GetExpansionFunction nell'oggetto di IXMLDOMNode oggetto e chiamate l'altra XmlElement metodo.
Esempi
Di seguito è illustrato il framework gestito del pacchetto implementa questo GetExpansionFunction metodo.In questo esempio viene illustrato come convertire IXMLDOMNode nell'oggetto XmlElement oggetto in c#.
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using System.Xml;
using System;
namespace Microsoft.VisualStudio.Package
{
[CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ExpansionProvider : IDisposable, IVsExpansionClient
{
public virtual int GetExpansionFunction(
MSXML.IXMLDOMNode xmlFunctionNode,
string fieldName,
out IVsExpansionFunction func)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlFunctionNode.xml);
func = GetExpansionFunction(doc.DocumentElement, fieldName);
return VsConstants.S_OK;
}
}
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.