侦听特定内容类型的文本缓冲区,以确定何时在文本编辑器中打开或关闭了这些文本缓冲区。
命名空间: Microsoft.VisualStudio.Text.Editor
程序集: Microsoft.VisualStudio.Text.UI.Wpf(在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)
语法
声明
Public Interface IWpfTextViewConnectionListener
public interface IWpfTextViewConnectionListener
public interface class IWpfTextViewConnectionListener
type IWpfTextViewConnectionListener = interface end
public interface IWpfTextViewConnectionListener
IWpfTextViewConnectionListener 类型公开以下成员。
方法
名称 | 说明 | |
---|---|---|
![]() |
SubjectBuffersConnected | 当相应 IContentType 的一个或多个 ITextBuffer 对象连接到 ITextView 时调用。 |
![]() |
SubjectBuffersDisconnected | 当一个或多个 ITextBuffer 对象不再满足主题缓冲区中所包含的条件时调用。 |
页首
备注
这是 MEF 组件部件,应通过以下属性:
[Export(typeof(IWpfTextViewConnectionListener))] [ContentType("...")] [TextViewRole("...")]
,如果扩展取决于文本视图,的内容类型使用此接口而不是 IWpfTextViewCreationListener 。 这是因为, SubjectBuffersConnected 调用,当现有缓冲内容类型更改为适当的内容类型 (与实时,以便在连接到视图) 时,,而 TextViewCreated 仅对文本视图的创建。