イベント オブジェクト (プロジェクトの種類に固有)

更新 : 2007 年 11 月

Visual C#、Visual Basic、および Visual J# に固有の使用可能なイベント オブジェクトのほとんどは、VSProjectEvents2 オブジェクトのプロパティとして表されます。また、ProjectItemsEvents オブジェクトおよび ProjectsEvents オブジェクトも、プロジェクトの種類ごとに使用できます。プロジェクトの種類に固有のすべての Visual Studio イベント オブジェクトを次の表に示します。各オブジェクトが提供するイベントを参照するには、リンクをクリックしてください。

イベント オブジェクト

オブジェクト名

説明

BuildManagerEvents

ビルド マネージャに対するイベントを提供します。

ImportsEvents

Imports イベントを提供します。Visual Basic でのみ使用できます。

ReferencesEvents

プロジェクト参照を追加、変更、または削除するためのイベントを提供します。

VSLangProjWebReferencesEvents

Web 参照を追加、変更、または削除するためのイベントを提供します。

ProjectItemsEvents

プロジェクト項目に対するイベントを提供します。提供されるイベントは、Visual Studio のすべてのプロジェクトの種類用に定義されています。

ProjectsEvents

プロジェクトに対するイベントを提供します。提供されるイベントは、Visual Studio のすべてのプロジェクトの種類用に定義されています。

プロジェクトの種類の指定

プロジェクトの種類に固有のさまざまなイベント オブジェクトをオートメーション モデルから取得するには、次の構文を使用します。

' Declaration.
Public WithEvents prjEventHandler As EnvDTE.ProjectsEvents
' Retrieve the event objects from the automation model
prjEventHandler = EnvDTE.Events.GetObject("VBProjectsEvents")
// Declaration.
Private EnvDTE.ProjectsEvents prjEventHandler;
// Retrieve the event objects from the automation model.
prjEventHandler = EnvDTE.Events.GetObject("VBReferencesEvents");

または

' Declaration
Public WithEvents refEvents As VSLangProj80.ReferencesEvents
' Retrieve the event objects from the automation model.
refEvents = CType(EnvDTE.Events.GetObject("VJSharpReferencesEvents"), _
 VSLangProj.ReferencesEvents)
// Declaration.
private VSLangProj.ReferencesEvents refEvents;
// Retrieve the event objects from the automation model
refEvents = (VSLangProj.ReferencesEvents)
EnvDTE.Events.GetObject("CSharpReferencesEvents");

GetObject に渡される名前は、プロジェクトの種類を反映します。Visual C#、Visual Basic、および Visual J# の各プロジェクトのプロジェクトの種類に固有のすべてのイベント オブジェクトの一覧を次の表に示します。

プロジェクトの種類に固有のイベント名の一覧

イベント オブジェクト名

説明

VBBuildManagerEvents

Visual Basic プロジェクトの BuildManagerEvents オブジェクトを返します。

VBImportsEvents

Visual Basic プロジェクトの ImportsEvents オブジェクトを返します。

VBProjectItemsEvents

Visual Basic プロジェクトの ProjectItemsEvents オブジェクトを返します。

VBProjectsEvents

Visual Basic プロジェクトの ProjectsEvents オブジェクトを返します。

VBReferencesEvents

Visual Basic プロジェクトの ReferencesEvents オブジェクトを返します。

VJSharpBuildManagagerEvents

Visual J# プロジェクトの BuildManagerEvents オブジェクトを返します。

VJSharpProjectItemsEvents

Visual J# プロジェクトの ProjectItemsEvents オブジェクトを返します。

VJSharpProjectsEvents

Visual J# プロジェクトの ProjectsEvents オブジェクトを返します。

VJSharpReferencesEvents

Visual J# プロジェクトの ReferencesEvents オブジェクトを返します。

CSharpBuildManagerEvents

Visual C# プロジェクトの BuildManagerEvents オブジェクトを返します。

CSharpProjectItemsEvents

Visual C# プロジェクトの ProjectItemsEvents オブジェクトを返します。

CSharpProjectsEvents

Visual C# プロジェクトの ProjectsEvents オブジェクトを返します。

CSharpReferencesEvents

Visual C# プロジェクトの ReferencesEvents オブジェクトを返します。

上記の文字列は、レジストリの HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\<Package GUID> キーの下にあります。パッケージの GUID を次に示します。

  • 164B10B9-B200-11D0-8C61-00A0C91E29D5 (Visual Basic プロジェクト システムの場合)。

  • E6FDF8B0-F3D1-11D4-8576-0002A516ECE8 (Visual J# プロジェクト システムの場合)。

  • FAE04EC1-301F-11D3-BF4B-00C04F79EFBC (Visual C# プロジェクト システムの場合)。

    ms228954.alert_note(ja-jp,VS.90).gifメモ :

    上記の GUID は、Microsoft Visual Studio 2005 でのみ有効です。

参照

概念

オートメーション イベント オブジェクト

その他の技術情報

イベントへの応答 (Visual Basic および Visual C# プロジェクト)

オートメーション イベントへの応答