Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

UIHierarchyItems Interface

Represents a given level of the UI hierarchy tree. It also represents a collection of the selected items in the tree.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

'Declaration
<GuidAttribute("DB8406B0-A916-449C-A277-BB04028F4394")> _
Public Interface UIHierarchyItems
	Inherits IEnumerable
'Usage
Dim instance As UIHierarchyItems

/** @attribute GuidAttribute("DB8406B0-A916-449C-A277-BB04028F4394") */ 
public interface UIHierarchyItems extends IEnumerable
GuidAttribute("DB8406B0-A916-449C-A277-BB04028F4394") 
public interface UIHierarchyItems extends IEnumerable

For alternate ways to use the UIHierarchyItems collection to access nodes, see UIHierarchy object.

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

Community Additions

ADD
Show:
© 2015 Microsoft