IVsTextViewCreationListener 接口

引发的事件的侦听器,当文本视图适配器 (IVsTextView) 将创建并初始化。

命名空间:  Microsoft.VisualStudio.Editor
程序集:  Microsoft.VisualStudio.Editor(在 Microsoft.VisualStudio.Editor.dll 中)

语法

声明
Public Interface IVsTextViewCreationListener
public interface IVsTextViewCreationListener
public interface class IVsTextViewCreationListener
type IVsTextViewCreationListener =  interface end
public interface IVsTextViewCreationListener

IVsTextViewCreationListener 类型公开以下成员。

方法

  名称 说明
公共方法 VsTextViewCreated 在已创建并初始化 IVsTextView 适配器时调用。

页首

备注

使用下面的特性,导出程序必须指示其导出:

[Export(typeof(IVsTextViewCreationListener))] 

在筛选特定 ContentTypeAttributeTextViewRoleAttribute的此侦听器。

例如,用于可编辑的文本视图限制此侦听器,则可以使用以下属性:

[Export(typeof(IVsTextViewCreationListener))]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Editable)]

有关使用 ContentTypeAttributeTextViewRoleAttribute 的更多信息,请参见 编辑扩展点

,当要在该扩展时,的处理特定击键可以使用此侦听器。 通过对执行此文本视图适配器 (IVsTextView),当创建文本视图,则使用此引用添加命令筛选器到视图 (通过使用 AddCommandFilter)。

示例

可以在中找到此接口的示例以下演练中的:

演练:显示签名帮助

演练:显示的语句完成

演练:使用编辑器扩展的快捷键

请参阅

参考

Microsoft.VisualStudio.Editor 命名空间