次の方法で共有


SelectionContainer インターフェイス

プロジェクト項目レベルの下の選択範囲を表すオブジェクト付きの選択コンテキストを表示します。

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

構文

'宣言
<GuidAttribute("02273422-8DD4-4A9F-8A8B-D70443D510F4")> _
Public Interface SelectionContainer _
    Inherits IEnumerable
[GuidAttribute("02273422-8DD4-4A9F-8A8B-D70443D510F4")]
public interface SelectionContainer : IEnumerable
[GuidAttribute(L"02273422-8DD4-4A9F-8A8B-D70443D510F4")]
public interface class SelectionContainer : IEnumerable
[<GuidAttribute("02273422-8DD4-4A9F-8A8B-D70443D510F4")>]
type SelectionContainer =  
    interface 
        interface IEnumerable 
    end
public interface SelectionContainer extends IEnumerable

SelectionContainer 型で公開されるメンバーは以下のとおりです。

プロパティ

  名前 説明
パブリック プロパティ Count コレクション内のオブジェクトの数を示す値を取得します。
パブリック プロパティ DTE トップレベルの機能拡張オブジェクトを取得します。
パブリック プロパティ Parent SelectionContainer オブジェクトの直接の親オブジェクトを取得します。

このページのトップへ

メソッド

  名前 説明
パブリック メソッド GetEnumerator コレクション内の項目の列挙子を取得します。
パブリック メソッド Item SelectionContainer コレクション内のオブジェクトを返します。

このページのトップへ

解説

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

参照

関連項目

EnvDTE 名前空間