_DTE.SelectedItems 屬性
取得包含目前環境中所選取之項目的集合。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
'宣告
ReadOnly Property SelectedItems As SelectedItems
SelectedItems SelectedItems { get; }
property SelectedItems^ SelectedItems {
SelectedItems^ get ();
}
abstract SelectedItems : SelectedItems
function get SelectedItems () : SelectedItems
屬性值
型別:EnvDTE.SelectedItems
SelectedItems 集合。
範例
Sub SelectedItemsExample(ByVal dte As DTE2)
' Before running this example, open a project and select some items
' in Solution Explorer.
Dim item As SelectedItem
Dim msg As String
For Each item In dte.SelectedItems
msg &= item.Name & vbCrLf
Next
MsgBox("The following items are selected in Solution Explorer:" & _
vbCrLf & vbCrLf & msg)
End Sub
public void SelectedItemsExample(DTE2 dte)
{
// Before running this example, open a project and select some
// items in Solution Explorer.
string msg = "";
foreach (SelectedItem item in dte.SelectedItems)
msg += item.Name + "\n";
MessageBox.Show(
"The following items are selected in Solution Explorer:\n\n" +
msg);
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。