IWpfTextViewConnectionListener Interface

Listens to text buffers of a particular content type to find out when they are opened or closed in the text editor.

Namespace:  Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)

Syntax

'Declaration
Public Interface IWpfTextViewConnectionListener
public interface IWpfTextViewConnectionListener
public interface class IWpfTextViewConnectionListener
type IWpfTextViewConnectionListener =  interface end
public interface IWpfTextViewConnectionListener

The IWpfTextViewConnectionListener type exposes the following members.

Methods

  Name Description
Public method SubjectBuffersConnected Called when one or more ITextBuffer objects of the appropriate IContentType are connected to a ITextView.
Public method SubjectBuffersDisconnected Called when one or more ITextBuffer objects no longer satisfy the conditions for being included in the subject buffers.

Top

Remarks

This is a MEF component part, and should be exported with the following attribute:

[Export(typeof(IWpfTextViewConnectionListener))] [ContentType("...")] [TextViewRole("...")]

Use this interface instead of IWpfTextViewCreationListener if your extension depends on the content type of the text view. This is because SubjectBuffersConnected is called when the content type of an existing buffer is changed to the appropriate content type (as well as when it is connected to the view), while TextViewCreated is called only at the creation of a text view.

See Also

Reference

Microsoft.VisualStudio.Text.Editor Namespace