この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。
訳文
原文
このトピックはまだ評価されていません - このトピックを評価する

SelectionContainer インターフェイス

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

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)
[GuidAttribute("02273422-8DD4-4A9F-8A8B-D70443D510F4")]
public interface SelectionContainer : IEnumerable

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

  名前 説明
パブリック プロパティ Count コレクション内のオブジェクトの数を示す値を取得します。
パブリック プロパティ DTE トップレベルの機能拡張オブジェクトを取得します。
パブリック プロパティ Parent SelectionContainer オブジェクトの直接の親オブジェクトを取得します。
このページのトップへ
  名前 説明
パブリック メソッド GetEnumerator() コレクションを反復処理する列挙子を返します。 (IEnumerable から継承されます。)
パブリック メソッド 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
この情報は役に立ちましたか。
(残り 1500 文字)
コミュニティ コンテンツ 追加
注釈 FAQ