Compartilhar via


ExpansionProvider.InsertSpecificExpansion Method

Inserts the specific snippet into the source at the specified position.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.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.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

'Declaration
Public Overridable Function InsertSpecificExpansion ( _
    view As IVsTextView, _
    snippet As XmlElement, _
    pos As TextSpan, _
    relativePath As String _
) As Boolean
public virtual bool InsertSpecificExpansion(
    IVsTextView view,
    XmlElement snippet,
    TextSpan pos,
    string relativePath
)
public:
virtual bool InsertSpecificExpansion(
    IVsTextView^ view, 
    XmlElement^ snippet, 
    TextSpan pos, 
    String^ relativePath
)
abstract InsertSpecificExpansion : 
        view:IVsTextView * 
        snippet:XmlElement * 
        pos:TextSpan * 
        relativePath:string -> bool  
override InsertSpecificExpansion : 
        view:IVsTextView * 
        snippet:XmlElement * 
        pos:TextSpan * 
        relativePath:string -> bool
public function InsertSpecificExpansion(
    view : IVsTextView, 
    snippet : XmlElement, 
    pos : TextSpan, 
    relativePath : String
) : boolean

Parameters

  • snippet
    Type: XmlElement

    [in] An XmlElement object containing the snippet to insert.

  • relativePath
    Type: String

    [in] A relative path to the snippet template file from which this snippet was taken.

Return Value

Type: Boolean
If the snippet was inserted, returns true; otherwise, returns false.

Remarks

The base method converts the XmlElement object to an IXMLDOMNode object and then calls the InsertSpecificExpansion method on the IVsExpansion object. If the InsertSpecificExpansion method is successful, the base method saves the IVsExpansionSession object that was returned and returns true; otherwise, the base method returns false.

.NET Framework Security

See Also

Reference

ExpansionProvider Class

Microsoft.VisualStudio.Package Namespace