How to access the filter functions

The filter functions "Create", "Edit" and "Open" can be accessed via the command line The formats are:
SLNTools.exe CreateFilterFileFromSolution <SourceSolution.sln>
SLNTools.exe EditFilterFile <FilterFile.slnfilter>
SLNTools.exe OpenFilterFile <FilterFile.slnfilter> [/Wait]

Those functions can also be accessed via file type commands that are created by the installer. A "Create Filter" command is associated to the '.sln' extension. And "Open" and "Edit" commands are associated to the '.slnfilter' file (with "Open" as the default command).

User interface

When creating or editing a filter, the following user interface is used:

CreateOrEditFilterFile.JPG

When a project name in the tree view is written in green, this means that the project has been checked by the user or the project is a dependency of one of the checked projects. If a solution folder is selected, all the childs of that solution folder will be included in the filtered solution, along all theirs dependencies.

By default, the open filter function does not have a user interface but, if the "Watch for changes on the filtered solution" option is selected, the following dialog will appear if the filtered solution is modified:

UpdateOriginalSolutionReadOnly.JPG

How does it work

First of all, it should be noted that the functions to create or edit a filter file does not create the final filtered solution. Only a file containing the rules for the filtering is created. The content of the file looks like this:

FilterFileContent.JPG

This mean that the filtering is dynamic. By example, if a reference is added to a "project to keep" in the source solution, the filtered solution will include the referenced project the next time the filter file is opened without having to edit the filter file.

Filtering solutions in SLNTools work like this:
  1. When a filter file is opened, the original solution specified in the filter file is read and a filtered solution is created using the "project to keep" list. If the "Watch for changes on the filtered solution" option is set to true, a solution folder "-OriginalSolution-" is also added to the filtered solution.
  2. SLNTools open the "filtered solution" normally (i.e. Visual Studio is started).
  3. If the "Watch for changes on the filtered solution" is set to false and the command line parameter "/Wait" is not set then SLNTools close. If not, SLNTools stay alive until Visual Studio is closed.
  4. If the "Watch for changes on the filtered solution" then SLNTools try to detect changes made to the filtered solution. When changes are detected, SLNTools offer the user the choice to apply those changes in the original solution.

Known bugs and limitations