IVsExpansionSession Interface
Represents the state of a newly inserted code snippet that is being edited by the user.
Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)
Syntax
'宣告
<GuidAttribute("3DFA7603-3B51-4484-81CD-FF1470123C7C")> _
<InterfaceTypeAttribute()> _
Public Interface IVsExpansionSession
'用途
Dim instance As IVsExpansionSession
[GuidAttribute("3DFA7603-3B51-4484-81CD-FF1470123C7C")]
[InterfaceTypeAttribute()]
public interface IVsExpansionSession
[GuidAttribute(L"3DFA7603-3B51-4484-81CD-FF1470123C7C")]
[InterfaceTypeAttribute()]
public interface class IVsExpansionSession
[<GuidAttribute("3DFA7603-3B51-4484-81CD-FF1470123C7C")>]
[<InterfaceTypeAttribute()>]
type IVsExpansionSession = interface end
public interface IVsExpansionSession
Remarks
This interface provides a number of useful methods to support the special code snippet edit mode as well as gaining access to the code snippet XML elements.
Code Snippet Edit Mode
After a code snippet has been inserted into the source document, a special edit mode is enabled that supports tabbing between multiple fields of the code snippet as well as selecting from lists of values associated with fields. The special edit mode is ended when the user types Enter or ESC. If this special edit mode is supported, it must be implemented by the language service that supports the code snippet. Otherwise, the language service should call the EndCurrentExpansion method on this interface to indicate that the code snippet has been accepted and nothing further needs to be done to the snippet.
Notes to Implementers
This interface is implemented by the same entity that implements the IVsExpansion interface (which in turn is implemented on an IVsTextBuffer object).
Notes to Callers
This interface is returned from the InsertExpansion(TextSpan2, TextSpan2, IVsExpansionClient, Guid, IVsExpansionSession%), InsertNamedExpansion(String, String, TextSpan2, IVsExpansionClient, Guid, Int32, IVsExpansionSession%), and InsertSpecificExpansion(IXMLDOMNode, TextSpan2, IVsExpansionClient, Guid, String, IVsExpansionSession%) methods in the IVsExpansion interface. The IVsExpansionSession interface is used to implement the snippet special edit mode and is passed to the OnBeforeInsertion and OnAfterInsertion methods in the IVsExpansionClient interface.