この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 |
訳文
原文
|
UIHierarchyItems インターフェイス
特定のレベルの UI 階層ツリーを表します。 また、そのツリー内で選択されている項目のコレクションも表します。
アセンブリ: EnvDTE (EnvDTE.dll 内)
UIHierarchyItems 型で公開されるメンバーは以下のとおりです。
| 名前 | 説明 | |
|---|---|---|
|
Count | UIHierarchyItems コレクション内のオブジェクトの数を示す値を取得します。 |
|
DTE | トップ レベルの機能拡張オブジェクトを取得します。 |
|
Expanded | 階層内でノードを展開するかどうかを設定または取得します。 |
|
Parent | UIHierarchyItems コレクションの直接の親オブジェクトを取得します。 |
| 名前 | 説明 | |
|---|---|---|
|
GetEnumerator() | コレクションを反復処理する列挙子を返します。 (IEnumerable から継承されます。) |
|
GetEnumerator() | コレクション内の項目の列挙子を取得します。 |
|
Item | UIHierarchyItems コレクション内の UIHierarchyItem オブジェクトを返します。 |
UIHierarchyItems コレクションを使用してノードにアクセスする他の方法については、UIHierarchy オブジェクトに関するトピックを参照してください。
Sub UIHierarchyItemsExample() ' Reference the UIHierarchy, UIHierarchyItem, and OutputWindow objects. Dim UIH As UIHierarchy = _ DTE.Windows.Item(Constants.vsWindowKindMacroExplorer).Object Dim samples As UIHierarchyItem = UIH.GetItem("Macros\Samples") Dim OWPane As OutputWindowPane = GetOutputWindowPane("List Macros") Dim file As UIHierarchyItem OWPane.Clear() For Each file In samples.UIHierarchyItems OWPane.OutputString(file.Name & _ Microsoft.VisualBasic.Constants.vbCrLf) Dim macro As UIHierarchyItem For Each macro In file.UIHierarchyItems OWPane.OutputString(" " & macro.Name & _ Microsoft.VisualBasic.Constants.vbCrLf) Next Next End Sub Function GetOutputWindowPane(ByVal Name As String, Optional ByVal show _ As Boolean = True) As OutputWindowPane Dim win As Window = _ DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput) If show Then win.Visible = True Dim ow As OutputWindow = win.Object Dim owpane As OutputWindowPane Try owpane = ow.OutputWindowPanes.Item(Name) Catch e As System.Exception owpane = ow.OutputWindowPanes.Add(Name) End Try owpane.Activate() Return owpane End Function