locked
IVsHierarchy sample or tutorial for VS2010 (Server Explorer like addin) RRS feed

  • Question

  • Environment: VS2010

    I am trying to make an extension with the following requirements

    1. Need a tool window like solution explorer.
    2. Double click on a node will open a custom editor.
    3. The editor will NOT be linked to a file.
    4. The extension should work with or without any solution opened.

    So you can say it is like Server explorer. I came to know after search that i have to use IVsHierarchy and IVsUIHierarchy etc to implement this. I found some samples for that for vs2008 but was unable to find any basic tutorial/sample for vs2010.

    It would be nice if someone can point to some basic tutorial /sample of custom hierarchy that will work on vs2010 or 2012.

    If you can tell any other method to do it, please advice.

    Thanks



    Aziz ur Rahman http://www.dotnetpanda.com

    Tuesday, September 25, 2012 10:35 PM

Answers

  • I have downloaded Mr.<a href="http://social.msdn.microsoft.com/profile/ed%20dore/?ws=usercard-mini">Ed Dore</a> sample for Visual Studio 2008 from <a href="http://vsx-insider.blogspot.com/2008/08/ed-dore-vsx-samples-from-closed.html">VSX Insider</a>, merged it with default package project created by Visual Studio 2010, made it working and upload it here. Please feel free to use it. I will ask Mr Ed Dore for approval to change and share it.

    HierAnarchy.zip (378.70 kb)</a>


    Aziz ur Rahman http://www.dotnetpanda.com


    Wednesday, September 26, 2012 3:06 AM

All replies

  • Hi Aziz,

    I'm just starting to work on a sample that shows how to reuse the VsHierarchyWindow for your own toolwindow. I've got the basic project setup up, and it brings up the toolwindow, but I'm just getting started on the IVsUIHierarchy implementation. Basically, it'll just be a file explorer (to illustrate the basics).

    If you're looking to launch editors to edit whatever the nodes represent, I seem to recall you'll need to implement IVsProject as well. I built a WPF based "hierarchy" toolwindow (doesn't use the IDEs VsHierarchyToolWndow), that will launch a custom editor for a given node. The nodes are not file based, so it may give you some ideas.

    Just fire me an email (email is on my MSDN profile page), and I'll pass it along.

    Sincerely,


    Ed Dore

    Wednesday, September 26, 2012 2:36 AM
  • Thanks Ed.

    Actually i have downloaded YOUR HierAnarchy sample from somewhere. Created a new project using visual studio 2010. Merged both projects and now it is working.

    I got simpleHierarchy sample to work. I will upload it in a couple of minutes. I am doing the renaming of files so that it will match with your original code

    and i will be glad to download your new sample :D


    Aziz ur Rahman http://www.dotnetpanda.com

    Wednesday, September 26, 2012 2:40 AM
  • My goal with this new sample is to dynamically generate the file nodes in a given folder on demand (when the folder is first expanded). The hierarchy implementation will definitely be different, but the way the toolwindow is created will be almost identical.

    Fire me an email, and I'll send you that other sample, as it has a basic editor that I launch from the hierarchy implementation (though in that sample the toolwindow is my own WPF creation, and doesn't use the VsHierarchyWindow.


    Ed Dore

    Wednesday, September 26, 2012 2:55 AM
  • I have downloaded Mr.<a href="http://social.msdn.microsoft.com/profile/ed%20dore/?ws=usercard-mini">Ed Dore</a> sample for Visual Studio 2008 from <a href="http://vsx-insider.blogspot.com/2008/08/ed-dore-vsx-samples-from-closed.html">VSX Insider</a>, merged it with default package project created by Visual Studio 2010, made it working and upload it here. Please feel free to use it. I will ask Mr Ed Dore for approval to change and share it.

    HierAnarchy.zip (378.70 kb)</a>


    Aziz ur Rahman http://www.dotnetpanda.com


    Wednesday, September 26, 2012 3:06 AM
  • I have send email to you using the contact US page from your blog. Let me know if you did not get my email.

    Aziz ur Rahman http://www.dotnetpanda.com

    Wednesday, September 26, 2012 3:14 AM
  • It is appreciate that you got Ed's example working in Visual Studio 2010 and share it here.

    It will be very beneficial for other community members who want to learn it.

    Thursday, September 27, 2012 2:43 AM
  • Thanks Disley.

    I am learning and updating that sample. Right now I have updated it to open my custom editor instead of Visual Studio browser window. If somebody needs that update, i will be happy to post it.

    Right now I am waiting for Mr.Ed new sample which will show how to implement hierarchy without using VsHierarchyWindow.


    Aziz ur Rahman http://www.dotnetpanda.com

    Thursday, September 27, 2012 2:51 AM