SelectedItem Interface
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Representa projetos selecionados ou itens de projeto no IDE (ambiente de desenvolvimento integrado) do Visual Studio.
public interface class SelectedItem
public interface class SelectedItem
__interface SelectedItem
[System.Runtime.InteropServices.Guid("049D2CDF-3731-4CB6-A233-BE97BCE922D3")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface SelectedItem
[<System.Runtime.InteropServices.Guid("049D2CDF-3731-4CB6-A233-BE97BCE922D3")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type SelectedItem = interface
Public Interface SelectedItem
- Atributos
Exemplos
Sub SelectionContainerSelectedItemExample()
Dim SelItems As SelectedItems
Dim SelItemObj As SelectedItem
Dim SelContain As SelectionContainer
Dim SelItem As SelectedItem
Dim NameStr As String
SelItems = DTE.SelectedItems
' List the number of items selected.
If SelItems.MultiSelect = True Then
MsgBox("You have " & SelItems.Count & " items selected in _
Solution Explorer.")
End If
' Set a reference to the first selected item.
SelItemObj = SelItems.Item(1)
' List the names of the project or project items under the selected
' item.
For Each SelItem In SelItemObj.Collection
NameStr = NameStr & SelItem.Name
If TypeOf SelItem.Project Is Project Then
NameStr = NameStr & " Project-" & SelItem.Project.Name & vbCrLf
Else
If TypeOf SelItem.ProjectItem Is ProjectItem Then
NameStr = NameStr & SelItem.ProjectItem.FileNames(1) & vbCrLf
End If
End If
Next
MsgBox("You selected: " & NameStr)
End Sub
Propriedades
| Collection |
Obtém a SelectedItems coleção que contém o SelectedItem objeto que dá suporte a isso. |
| DTE |
Obtém o objeto de extensibilidade de nível superior. |
| Info[Int16] |
Somente para uso interno da Microsoft. |
| InfoCount |
Somente para uso interno da Microsoft. |
| Name |
Obtém o nome do objeto SelectedItem. |
| Project |
Obtém o objeto Project associado ao objeto SelectedItem. |
| ProjectItem |
Obtém o ProjectItem objeto associado ao objeto fornecido. |