Events2 介面

允許存取擴充性模型中的所有事件。 事件也可以從擴充性模型中的特定物件存取。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.dll 中)

語法

'宣告
<GuidAttribute("BED31E8C-F845-4397-AF13-6B82A6996C0D")> _
Public Interface Events2 _
    Inherits Events
[GuidAttribute("BED31E8C-F845-4397-AF13-6B82A6996C0D")]
public interface Events2 : Events
[GuidAttribute(L"BED31E8C-F845-4397-AF13-6B82A6996C0D")]
public interface class Events2 : Events
[<GuidAttribute("BED31E8C-F845-4397-AF13-6B82A6996C0D")>]
type Events2 =  
    interface
        interface Events
    end
public interface Events2 extends Events

Events2 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 BuildEvents (繼承自 Events)。
公用屬性 BuildEvents 取得 BuildEvents 物件,此物件提供方案建置的事件。
公用屬性 CodeModelEvents 取得 CodeModelEvents 物件,此物件提供程式碼模型的事件。
公用屬性 CommandBarEvents[Object] (繼承自 Events)。
公用屬性 CommandBarEvents[Object] 傳回物件,它所提供的事件會在按下所提供之 CommandBarControl 物件時引發。
公用屬性 CommandEvents[String, Int32] (繼承自 Events)。
公用屬性 CommandEvents[String, Int32] 取得指定命令的 CommandEvents
公用屬性 DebuggerEvents (繼承自 Events)。
公用屬性 DebuggerEvents 取得物件,此物件提供來自偵錯工具的事件。
公用屬性 DebuggerExpressionEvaluationEvents 取得事件物件,它是當偵錯工具開始或停止運算式評估時用以接受通知的物件。
公用屬性 DebuggerProcessEvents 擷取事件物件,它是當執行或停止已偵錯的處理序時用以通知的物件。
公用屬性 DocumentEvents[Document] (繼承自 Events)。
公用屬性 DocumentEvents[Document] 取得 DocumentEvents,它提供文件的事件。
公用屬性 DTEEvents (繼承自 Events)。
公用屬性 DTEEvents 取得 DTEEvents 物件,此物件提供開發環境的事件。
公用屬性 FindEvents (繼承自 Events)。
公用屬性 FindEvents 取得 Find 作業的 FindEvents
公用屬性 MiscFilesEvents (繼承自 Events)。
公用屬性 MiscFilesEvents 取得方案的 ProjectItemsEvents
公用屬性 OutputWindowEvents[String] (繼承自 Events)。
公用屬性 OutputWindowEvents[String] 取得視窗事件的 OutputWindowEvents
公用屬性 ProjectItemsEvents 取得事件物件,用以尋找方案中所有專案項目的事件。
公用屬性 ProjectsEvents 取得事件物件,用以尋找方案中所有專案的事件。
公用屬性 PublishEvents 取得用以註解發行事件的物件。
公用屬性 SelectionEvents (繼承自 Events)。
公用屬性 SelectionEvents 取得選取範圍的 SelectionEvents
公用屬性 SolutionEvents (繼承自 Events)。
公用屬性 SolutionEvents 取得方案的 SolutionEvents 物件。
公用屬性 SolutionItemsEvents (繼承自 Events)。
公用屬性 SolutionItemsEvents 取得方案的 ProjectItemsEvents 物件。
公用屬性 TaskListEvents[String] (繼承自 Events)。
公用屬性 TaskListEvents[String] 取得開發環境的 TaskListEvents
公用屬性 TextDocumentKeyPressEvents 取得事件物件,用以尋找文字編輯器內的按下按鍵事件。
公用屬性 TextEditorEvents[TextDocument] (繼承自 Events)。
公用屬性 TextEditorEvents[TextDocument] 取得 IDE 的 TextEditorEvents 物件。
公用屬性 WindowEvents[Window] (繼承自 Events)。
公用屬性 WindowEvents[Window] 取得 WindowEvents 物件,此物件提供開發環境內視窗的事件。
公用屬性 WindowVisibilityEvents 取得事件物件,它是當工具視窗顯示或隱藏時用以接受通知的物件。

回頁首

方法

  名稱 說明
公用方法 GetObject(String) (繼承自 Events)。
公用方法 GetObject(String) 傳回晚期繫結至 DTE 物件,並可在執行階段以名稱存取的介面或物件。

回頁首

備註

Automation 模型包含根 Events 物件,可供任何程式語言撰寫的 Automation 用戶端參考 Automation 事件,例如:SolutionEvents

各種 IDE 工具、專案類型、編輯器等,都可以將它們專屬的其他事件加入至 Events 物件。 例如,Visual C++ 會加入 VCProjectItemsEvents 屬性。

範例

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

   Sub EventsExample()
      Dim addInInstance As EnvDTE.AddIn

      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

請參閱

參考

EnvDTE80 命名空間