I\'m adding some options for the Connection Node in the server explorer for my VS extension. For one of the menu options that I have added I need to get the connection string of
Marking my question as answered since the code that I posted did the trick.
EnvDTE80.DTE2 _applicationObject = GetDTE2();
UIHierarchy uih = _applicationObject.ToolWindows.GetToolWindow("Server Explorer") as UIHierarchy;
Array selectedItems = (Array)uih.SelectedItems;
if (null != selectedItems)
{
foreach (UIHierarchyItem selItem in selectedItems)
{
SelectedItem prjItem = selItem.Object as EnvDTE.SelectedItem;
string name = prjItem.Name;
}
}