We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to get the ADO Connection object from an item selected in Server Explorer.
I found this old thing - but is there a better way with Vsix Toolkit?
https://stackoverflow.com/questions/15541438/how-to-get-the-selected-connection-node-object-of-vs-server-explorer-window-ddex
(I am fine with just getting the name of the selected node)
The text was updated successfully, but these errors were encountered:
I ended up with this relativly unbrittle implementation:
var Dte2 = GetService(typeof(EnvDTE.DTE)) as EnvDTE80.DTE2; var uih = Dte2.ToolWindows.GetToolWindow(EnvDTE.Constants.vsWindowKindServerExplorer) as EnvDTE.UIHierarchy; var selectedItems = (Array)uih.SelectedItems; if (selectedItems != null) { var connectionName = ((EnvDTE.UIHierarchyItem)selectedItems.GetValue(0)).Name; var dataConnectionsService = await VS.GetServiceAsync<IVsDataExplorerConnectionManager, IVsDataExplorerConnectionManager>(); if (dataConnectionsService.Connections.TryGetValue(connectionName, out IVsDataExplorerConnection explorerConnection)) { var connection = explorerConnection.Connection; if (VsDataHelper.SupportedProviders.Contains(connection.Provider)) { menuCommand.Visible = true; } } }
Sorry, something went wrong.
No branches or pull requests
I am trying to get the ADO Connection object from an item selected in Server Explorer.
I found this old thing - but is there a better way with Vsix Toolkit?
https://stackoverflow.com/questions/15541438/how-to-get-the-selected-connection-node-object-of-vs-server-explorer-window-ddex
(I am fine with just getting the name of the selected node)
The text was updated successfully, but these errors were encountered: