DTE2.SelectedItems Property

 

Gets a collection containing the items currently selected in the environment.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

SelectedItems SelectedItems { get; }

Property Value

Type: EnvDTE.SelectedItems

A SelectedItems collection.

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);
}
Return to top
Show: