UIHierarchyItems 인터페이스
업데이트: 2007년 11월
UI 계층 구조 트리의 지정된 수준을 표시합니다. 또한 트리에서 선택한 항목의 컬렉션을 나타냅니다.
네임스페이스: EnvDTE
어셈블리: EnvDTE(EnvDTE.dll)
구문
<GuidAttribute("DB8406B0-A916-449C-A277-BB04028F4394")> _
Public Interface UIHierarchyItems _
Implements IEnumerable
Dim instance As UIHierarchyItems
[GuidAttribute("DB8406B0-A916-449C-A277-BB04028F4394")]
public interface UIHierarchyItems : IEnumerable
[GuidAttribute(L"DB8406B0-A916-449C-A277-BB04028F4394")]
public interface class UIHierarchyItems : IEnumerable
public interface UIHierarchyItems extends IEnumerable
설명
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