SelectedItem::Name Property
Visual Studio 2015
Gets the name of the SelectedItem object.
Assembly: EnvDTE (in EnvDTE.dll)
public void CodeExample(DTE2 dte) { try { // Open project and select one or more items in the // solution explorer before running this example. SelectedItem selItem; string msg = ""; if (dte.SelectedItems.Count > 0) { selItem = dte.SelectedItems.Item(1); msg = "The first selected item is " + selItem.Name; } MessageBox.Show(msg); } catch(Exception ex) { MessageBox.Show(ex.Message); } }
Show: