how to get the selected connection node object of VS Server Explorer window DDEX

自作多情 提交于 2019-12-02 04:36:11

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;
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!