SelectionContainer インターフェイス

更新 : 2007 年 11 月

プロジェクト項目レベルより下の選択項目をモデル化するオブジェクトによって選択コンテキストを表します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
<GuidAttribute("02273422-8DD4-4A9F-8A8B-D70443D510F4")> _
Public Interface SelectionContainer _
    Implements IEnumerable
'使用
Dim instance As SelectionContainer
[GuidAttribute("02273422-8DD4-4A9F-8A8B-D70443D510F4")]
public interface SelectionContainer : IEnumerable
[GuidAttribute(L"02273422-8DD4-4A9F-8A8B-D70443D510F4")]
public interface class SelectionContainer : IEnumerable
public interface SelectionContainer extends IEnumerable

解説

SelectionContainer オブジェクトは、汎用選択追跡オブジェクトです。環境には、DTE.SelectedItems.SelectionContainer というグローバル選択オブジェクトが 1 つ存在します。

SelectedItems は、個々の ProjectItem オブジェクトを表すコレクションです。このコレクションから Project オブジェクトを取得できます。項目はコンテキスト内の任意のオブジェクトの選択項目を提供できるため、SelectionContainer は、選択したオブジェクトの任意の型を表すことができます。

Sub SelectionContainerExample()
   Dim SelContain As SelectionContainer
   Dim ContainerItem As SelectedItem

   ' Set references to the selection container and its selected item.
   SelContain = DTE.SelectedItems.SelectionContainer
   ContainerItem = DTE.SelectedItems.Item(1)

   ' Print the name of the container of the selected item.
   MsgBox(ContainerItem.Name)
End Sub

参照

参照

SelectionContainer メンバ

EnvDTE 名前空間