UIHierarchyItems.Expanded 属性
设置或获取指示层次结构中的节点是否已展开的值。
命名空间: EnvDTE
程序集: EnvDTE(在 EnvDTE.dll 中)
语法
声明
Property Expanded As Boolean
Get
Set
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)
属性值
类型:System.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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。