_DTE.SelectedItems Property
Visual Studio 2015
Gets a collection containing the items currently selected in the environment.
Assembly: EnvDTE (in EnvDTE.dll)
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); }
Show: