UIHierarchyItems.Expanded 属性

设置或获取指示层次结构中的节点是否已展开的值。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Property Expanded As Boolean
bool Expanded { get; set; }
property bool Expanded {
    bool get ();
    void set (bool value);
}
abstract Expanded : bool with get, set
function get Expanded () : boolean 
function set Expanded (value : boolean)

属性值

类型:Boolean
一个布尔值,如果节点已展开,则为 true,否则为 false。

示例

Sub ExpandedExample()
   Dim UIH As UIHierarchy = _
     DTE.Windows.Item(Constants.vsWindowKindMacroExplorer).Object
   Dim UIHItem As UIHierarchyItem = UIH.GetItem("Macros\Samples")

   UIHItem.Select(vsUISelectionType.vsUISelectionTypeSetCaret)
   If UIHItem.IsSelected = False Then
      If UIH.UIHierarchyItems.Expanded = True Then
         MsgBox("Node is expanded.")
      Else
         MsgBox("Node is not expanded.")
      End If
   End If
   UIH.SelectDown(vsUISelectionType.vsUISelectionTypeSelect, 2)
   UIH.DoDefaultAction()
   UIH.SelectDown(vsUISelectionType.vsUISelectionTypeSelect, 1)
   UIH.SelectUp(vsUISelectionType.vsUISelectionTypeExtend, 1)
End Sub

.NET Framework 安全性

请参阅

参考

UIHierarchyItems 接口

EnvDTE 命名空间

其他资源

如何:使用 UIHierarchy 操作树视图