Share via


SelectedItems.SelectionContainer 属性

获取表示承载所选项的设计器的 SelectionContainer 对象。

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

语法

声明
ReadOnly Property SelectionContainer As SelectionContainer
SelectionContainer SelectionContainer { get; }
property SelectionContainer^ SelectionContainer {
    SelectionContainer^ get ();
}
abstract SelectionContainer : SelectionContainer with get
function get SelectionContainer () : SelectionContainer

属性值

类型:EnvDTE.SelectionContainer
一个 SelectionContainer 对象。

备注

SelectionContainer 以比 ProjectProjectItem 更细的粒度返回对象的集合。

示例

Sub SelectionContainerExample()
   Dim SelContain As SelectionContainer
   Dim ContainerItem As SelectedItem

   ' Set references to the selection container and its selected item.
   SelContain = DTE.SelectedItems.SelectionContainer
   ContainerItem = DTE.SelectedItems.Item(1)

   ' Print the name of the container of the selected item.
   MsgBox(ContainerItem.Name)
End Sub

.NET Framework 安全性

请参阅

参考

SelectedItems 接口

EnvDTE 命名空间