none
Show All Files button in Solution Explorer doesn't work.

    Question

  • Hi there,

    I need to show files in solution explorer. These are not in project exactly but they exist on hard drive (like bin and obj directories in C# projects) . In MPF sources (I mean ProjectNode.cs) we can see that code:

    /// <summary>
    /// Handles the shows all objects command.
    /// </summary>
    /// <returns></returns>
    internal protected virtual int ShowAllFiles()
    {
      return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
    }

    /// <summary>
    /// Unloads the project.
    /// </summary>
    /// <returns></returns>
    internal protected virtual int UnloadProject()
    {
      return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
    }

    That is interesting fact - methods UnloadProject() and ShowAllFiles() are the same but Unload Project function works and Show All Files doesn't work.

    Is it a bug or not? And how can I get the functionality ShowAllFiles?

    Please, help me! Any help will be much appreciated.

    Tuesday, August 08, 2006 11:07 AM

Answers

  • Hello Dmitry,

    Show All Files is a feature that has yet to be implemented in the MPF code. While it is possible that it gets added to the MPF at some point, my guess would be that this may take a while and there is not guaranty it would happen. As such, I would recommand implementing it yourself if you really want the feature.

    Rusty

    Wednesday, August 09, 2006 6:00 PM
  • When you want to implement a feature like Show All Files you basicly want to have all files/folders to show up as FileNodes but with a certain set of properties. There is one hierarchy property designed for this feature which is called VSHPROPID_IsNonMemberItem  You can override the GetProperty method on FileNode and FolderNode in order to add you logic for those items that you want to display in the hierarchy under certain conditions (like Show All Files). The next step would then be to override the properties VSHPROPID_FirstVisibleChild  and VSHPROPID_NextVisibleSibling which is the properties that is being asked by the VS Shell on everty hierarchy item in order to create you hierarchy tree in the solution explorer.

    There would be a lot more to consider when implementing this feature completely, but this should give a start....

    Thanks,

    Ole

    Monday, August 14, 2006 4:22 PM
  • Hallo Dmitry,

        I've received your mail and I'll try to help you with this but I have to warn you that, In my projects, I don't use the MPF classes. I've developed my own classes that wrap the interop interfaces and I've added my own logic to them.

        A detailed article about how to implement the "Show All Files", can be found if you follow this link to my technical blog below:

    http://bloggingabout.net/blogs/perikles/archive/2006/11/25/Implementing-_2600_quot_3B00_Show-All-Files_2600_quot_3B00_-in-a-Visual-Studio-project_2E00_.aspx

    Saturday, November 25, 2006 1:49 PM

All replies

  • Hi, what language are your projects? Are you simply clicking on the 'Show all Files' button in the solution explorer and not seeing any results?

    Thanks,

    -Prasadi

    Wednesday, August 09, 2006 1:44 AM
  • Hi Prasadi,

    The language of my projects is not one of the supported in Visual Studio, I'm developing the custom VS package for my custom language.

    Yes, I'm simply clicking on the "Show All Files" button in the Solution Explorer and not seeing the expected result (I expect the same behavior as it is in C# project).

    Can you help me?

    Thanks.

     

    Wednesday, August 09, 2006 10:43 AM
  • Hello Dmitry,

    Show All Files is a feature that has yet to be implemented in the MPF code. While it is possible that it gets added to the MPF at some point, my guess would be that this may take a while and there is not guaranty it would happen. As such, I would recommand implementing it yourself if you really want the feature.

    Rusty

    Wednesday, August 09, 2006 6:00 PM
  • Hi Rusty,

    Thank you for the provided information. It's very sad that this function doesn't work in MPF and I have to implement this standard feature myself.

    Could you give me a tip where to begin investigating this? Where is a place in MPF framework to add my code?

    Any help will be much appreciated!

     

    Friday, August 11, 2006 3:15 PM
  • When you want to implement a feature like Show All Files you basicly want to have all files/folders to show up as FileNodes but with a certain set of properties. There is one hierarchy property designed for this feature which is called VSHPROPID_IsNonMemberItem  You can override the GetProperty method on FileNode and FolderNode in order to add you logic for those items that you want to display in the hierarchy under certain conditions (like Show All Files). The next step would then be to override the properties VSHPROPID_FirstVisibleChild  and VSHPROPID_NextVisibleSibling which is the properties that is being asked by the VS Shell on everty hierarchy item in order to create you hierarchy tree in the solution explorer.

    There would be a lot more to consider when implementing this feature completely, but this should give a start....

    Thanks,

    Ole

    Monday, August 14, 2006 4:22 PM
  • Hi, Ole

    Thank you for the tips! I'll play with it shortly.

    Monday, August 14, 2006 4:54 PM
  • Hi there again,

    I still have "Show All Files" button doesn't work in my package :) Maybe anybody can give me some more information about what method(s) in MPF I should override to add this functionality?

    Some reasons to include this functionality into MPF:

    This feature is looking like a little cool thing but let’s imagine the situation. You are creating a package for new language to make it possible the development in that language under Visual Studio. A lot of code is already written using IDEs and editors. Congratulations – your package has been released! Users install your package and try to port their existing non-VS projects into the Visual Studio. And what will they see? They will see that they can’t press Show All Files button and then click “Include In Project” context menu item to include all needed source files into their new Visual Studio project. But… this sweet little button DOESN’T work! They will say – “Okay, we just continue to develop in our SomeVeryCoolEditor. It seams Visual Studio is not ready to make our life easer.“

    P.S. That is a joke of course. J But maybe this reason will be enough to include “Show All Files” feature to the next VSSDK…

     

     

    Friday, October 20, 2006 8:34 AM
  • Hi Ole,

    I've tried to understand how to implement this feature using pointers you provided but my research was not successful...

     

    I have got stuck...   

     

    Please, help me!

    Thursday, November 16, 2006 7:19 PM
  • Hello Dmitry,


    The way I've implemented it is to use the HierarchyNode AddChild method. Just build an AddNodes method that uses AddChild and call it recursively when you come across a directory. It works pretty well for me.

    But there is one problem - the SolutionExplorer window flashes as the nodes are added. So the question is - how do you stop the SolutionExplorer window flashing?

    This question has been asked on two separate occasions - once by me recently and once some time ago. The answer from Microsoft on the first occasion was to use the IVsLiteTree interface.

    But how do you get this interface? There is no information on how to do so!

    So if anyone from Microsoft could enlighten me, I'd be VERY grateful!

    Dermot
    Thursday, November 16, 2006 9:07 PM
  • Hi Dermot,

    Could you please post your implementation here?

    Thanks.

    Thursday, November 16, 2006 10:45 PM
  • Hallo Dmitry,

        I've received your mail and I'll try to help you with this but I have to warn you that, In my projects, I don't use the MPF classes. I've developed my own classes that wrap the interop interfaces and I've added my own logic to them.

        A detailed article about how to implement the "Show All Files", can be found if you follow this link to my technical blog below:

    http://bloggingabout.net/blogs/perikles/archive/2006/11/25/Implementing-_2600_quot_3B00_Show-All-Files_2600_quot_3B00_-in-a-Visual-Studio-project_2E00_.aspx

    Saturday, November 25, 2006 1:49 PM
  • Hi Perikles,

     

    Your blog post is very interesting but I could not map this onto my MPF based package. The latest MPF version contains some virtual (Overridable in VB) methods and I guess I need use them. Well, I will wait for MPF team help to investigate how to implement ‘Show All Files’ feature correctly. Thank you for your help one more time!

    Saturday, November 25, 2006 4:07 PM
  • Dmitry, have you succeeded with implementing "Show All Files" button?
    I've the same problem now and cannot find the solution...
    It looks like that by default in new version of SDK this button is not visible at all for new project types...

    Monday, July 30, 2007 3:06 PM
  • Hi Vadim,

     

    Yes, I do that. I'm going to prepair some blog posts in the future about how to implement that. I'll let you know here when it's done.

    Thursday, August 23, 2007 8:54 AM