次の方法で共有


ExpansionProvider.InsertSpecificExpansion Method

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

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 InsertSpecificExpansion ( _
    view As IVsTextView, _
    snippet As XmlElement, _
    pos As TextSpan, _
    relativePath As String _
) As Boolean
'使用
Dim instance As ExpansionProvider
Dim view As IVsTextView
Dim snippet As XmlElement
Dim pos As TextSpan
Dim relativePath As String
Dim returnValue As Boolean

returnValue = instance.InsertSpecificExpansion(view, _
    snippet, pos, relativePath)
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

  • relativePath
    Type: System.String
    [in] A relative path to the snippet template file from which this snippet was taken.

Return Value

Type: System.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

ExpansionProvider Members

Microsoft.VisualStudio.Package Namespace