Events 接口

定义

允许访问扩展性模型中的所有事件。 还可以从扩展性模型内的特定对象公开事件。

public interface class Events
public interface class Events
__interface Events
[System.Runtime.InteropServices.Guid("134170F8-93B1-42DD-9F89-A2AC7010BA07")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface Events
[<System.Runtime.InteropServices.Guid("134170F8-93B1-42DD-9F89-A2AC7010BA07")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type Events = interface
Public Interface Events
派生
属性

示例

Public Module Module1  
   Dim WithEvents bldevents As BuildEvents  
   Dim applicationObject As EnvDTE.DTE  

   Sub EventsExample()  
      applicationObject = CType(Application, EnvDTE.DTE)  
      bldevents = CType(applicationObject.Events.BuildEvents, EnvDTE.BuildEvents)  
   End Sub  

   Private Sub bldevents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles bldevents.OnBuildDone  
      MsgBox("Build complete")  
   End Sub  
End Module  

注解

自动化模型包含一个根 Events 对象,在该对象中,使用任何语言编写的自动化客户端都可以引用自动化事件,例如 SolutionEvents

各种 IDE 工具、项目类型、编辑器等可能会将特定事件添加到 Events 对象。 例如, Visual C++ 添加 VCProjectItemsEvents 属性。

属性

BuildEvents

获取一个 BuildEvents 对象,该对象为解决方案生成提供事件。

CommandBarEvents[Object]

获取一个对象,该对象提供在单击所提供的 CommandBarControl 对象时激发的事件。

CommandEvents[String, Int32]

获取 CommandEvents 指定命令的。

DebuggerEvents

获取提供调试器中的事件的对象。

DocumentEvents[Document]

获取 DocumentEvents 为文档提供事件的。

DTEEvents

获取 DTEEvents 为开发环境提供事件的。

FindEvents

获取 FindEvents 查找 操作的。

MiscFilesEvents

获取 ProjectItemsEvents 解决方案的。

OutputWindowEvents[String]

获取 OutputWindowEvents 窗口事件的。

SelectionEvents

获取 SelectionEvents 选定内容的。

SolutionEvents

获取 SolutionEvents 解决方案的对象。

SolutionItemsEvents

获取 ProjectItemsEvents 解决方案的对象。

TaskListEvents[String]

获取 TaskListEvents 开发环境的。

TextEditorEvents[TextDocument]

获取 TextEditorEvents IDE 的对象。

WindowEvents[Window]

获取 WindowEvents 为开发环境中的 windows 提供事件的对象。

方法

GetObject(String)

获取后期绑定到 DTE 对象的接口或对象,并且在运行时可通过名称访问。

适用于