visual studio extensions - how to get the selected connection node object of VS Server Explorer window DDEX -


I am adding some options for the connection node to my VS extension in Server Explorer. For the menu options I added, I need to get the connection string of the very selected connection, so I have tried before by adding some code to the LineStatus event and also in the command handler mode. But it seems that every time I want to get an example of DataViewHierarchyAccessor, since then I am missing something, I always get a zero value. Although I do the same thing but works fine in the lower level node. I have used the following code with no luck:

IVsDataExplorerNodeSelection Node Selection = (IVsDataExplorerNodeSelection) Package.GetGlobalService (Typef (IVsDataExplorerNodeSelection));

IVsUIHierarchy hierarchy = Marshal.GetTypedObjectForIUnknown (hierarchyPtr, typeof

Update:

It looks like I have found something I & Nsquo; progress on it , I tried it now:

  EnvDTE80.DTE2 _applicationObject = GetDTE2 (); UIHierarchy uih = _applicationObject.ToolWindows.GetToolWindow ("server explorer") as UIHierarchy; array selected items = (array ) Uih.SelectedItems; if (empty! = Selected items) {foreach (the selection of the item is selected from the UIHyartyItemSelstem) {selected Int'l prelimity = selItem.Object as EnvDTE.SelectedItem; string name = p RjItem.Name;}}   

Now my question is, what better way to put in the list of selected items? Instead of VTVTelected.

Thanks in advance .

Answer me since the code I posted to my question.

  EnvDTE80.DTE2 _applicationObject = GetDTE2 (); UIHierarchy uih = _applicationObject.ToolWindows.GetToolWindow ("Server Explorer") as UIHierarchy; Array selected items = (array) uih.SelectedItems; If (empty! = Selected items) {foreach (UIHearIKI itam selistum in selected items) {selected Indem preciatum = selItem.Object as EnvDTE.SelectedItem; String name = prjItem.Name; }}    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -