侦听创建文本视图事件。
命名空间: Microsoft.VisualStudio.Text.Editor
程序集: Microsoft.VisualStudio.Text.UI.Wpf(在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)
语法
声明
Public Interface IWpfTextViewCreationListener
public interface IWpfTextViewCreationListener
public interface class IWpfTextViewCreationListener
type IWpfTextViewCreationListener = interface end
public interface IWpfTextViewCreationListener
IWpfTextViewCreationListener 类型公开以下成员。
方法
名称 | 说明 | |
---|---|---|
![]() |
TextViewCreated | 调用时,将会文本视图匹配的角色中的文本数据模型创建具有匹配内容类型。 |
页首
备注
使用下面的特性,导出程序必须指定一 ContentTypeAttribute 和至少一 TextViewRoleAttribute,应将它们标记为的导出:
[Export(typeof(IWpfTextViewCreationListener))]
[ContentType(....)]
[TextViewRole(....)]
,如果扩展不依赖于文本视图,的内容类型使用此接口而不是 IWpfTextViewConnectionListener 。 这是因为, SubjectBuffersConnected 调用,当现有缓冲内容类型更改为适当的内容类型 (与实时,以便在连接到视图) 时,,而 TextViewCreated 仅对文本视图的创建。
示例
有关的示例演示如何使用此接口,请参见 演练:自定义文本视图。