Export (0) Print
Expand All

UIHierarchyItem Object

Visual Studio .NET 2003

Represents an item in a standard tool window in the integrated development environment (IDE) that shows hierarchical tree data, such as Solution Explorer.

DTE

   Windows

      Window

         UIHierarchy

            UIHierarchyItems

               UIHierarchyItem

[Visual Basic .NET]
Public Interface UIHierarchyItem
    Inherits IDispatch
[Visual Basic 6]
Class UIHierarchyItem
[C++]
interface UIHierarchyItem : IDispatch
[C#]
public interface UIHierarchyItem : IDispatch
[JScript .NET]
public interface UIHierarchyItem extends IDispatch

Requirements

Namespace: EnvDTE

File: dte.olb

Example

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

See Also

Manipulating Tree Views Using UIHierarchy | UIHierarchy Object | UIHierarchyItems Collection | UIHierarchyItems Property (General Extensibility) | UIHierarchyItem Object Properties, Methods, and Events

Show:
© 2015 Microsoft