共用方式為


SelectionContainer Interface

Definition

Represents the selection context with objects that model the selection below the project item level.

public interface class SelectionContainer : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("02273422-8DD4-4A9F-8A8B-D70443D510F4")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface SelectionContainer : System.Collections.IEnumerable
[System.Runtime.InteropServices.Guid("02273422-8DD4-4A9F-8A8B-D70443D510F4")]
public interface SelectionContainer : System.Collections.IEnumerable
[<System.Runtime.InteropServices.Guid("02273422-8DD4-4A9F-8A8B-D70443D510F4")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type SelectionContainer = interface
    interface IEnumerable
[<System.Runtime.InteropServices.Guid("02273422-8DD4-4A9F-8A8B-D70443D510F4")>]
type SelectionContainer = interface
    interface IEnumerable
Public Interface SelectionContainer
Implements IEnumerable
Attributes
Implements

Examples

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  

Remarks

The SelectionContainer object is a generic selection-tracking object. There is one global selection object for the environment: DTE.SelectedItems.SelectionContainer.

SelectedItems is a collection that represents individual ProjectItem objects, from which you can get the Project object. Because an item can offer a selection of an arbitrary object within its context, however, the SelectionContainer can represent any type of selected object.

Properties

Count

Gets a value indicating the number of objects in the collection.

DTE

Gets the top-level extensibility object.

Parent

Gets the immediate parent object of a SelectionContainer object.

Methods

GetEnumerator()

Gets an enumeration for items in a collection.

Item(Object)

Returns an object in the SelectionContainer collection.

Applies to