次の方法で共有


UIHierarchyItem インターフェイス

更新 : 2007 年 11 月

統合開発環境 (IDE: Integrated Development Environment) の標準ツール ウィンドウ内で階層ツリー構造のデータを表示するアイテム ([ソリューション エクスプローラ]など) を表します。

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

構文

'宣言
<GuidAttribute("FBD0D024-09CD-4D9F-9E2B-CACD628426A5")> _
Public Interface UIHierarchyItem
'使用
Dim instance As UIHierarchyItem
[GuidAttribute("FBD0D024-09CD-4D9F-9E2B-CACD628426A5")]
public interface UIHierarchyItem
[GuidAttribute(L"FBD0D024-09CD-4D9F-9E2B-CACD628426A5")]
public interface class UIHierarchyItem
public interface UIHierarchyItem

Sub UIHierarchyItemExample()
   '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

参照

参照

UIHierarchyItem メンバ

EnvDTE 名前空間

その他の技術情報

方法 : UIHierarchy を使用してツリー ビューを操作する