├── .editorconfig ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTORS.md ├── Cyotek.VisualStudioExtensions.AddProjects.sln ├── LICENSE.txt ├── README.md ├── res ├── Images.pdn ├── addprojects-findprojects.png ├── addprojects-main.png ├── addprojects-menu.png ├── addprojects-settings.png ├── icon-16.png ├── icon-196.png ├── icon-24.pdn ├── icon-24.png ├── icon-256.pdn ├── icon-256.png ├── icon-32.png ├── icon-48.png ├── icon-64.png └── icon-72.png └── src ├── AddProjectsDialog.Designer.cs ├── AddProjectsDialog.cs ├── AddProjectsDialog.resx ├── AddProjectsPackage.cs ├── BaseForm.Designer.cs ├── BaseForm.cs ├── BaseForm.resx ├── Cyotek.AddProjects.vsct ├── Cyotek.VisualStudioExtensions.AddProjects.csproj ├── ExtensionSettings.cs ├── ExtensionSettingsProjectCollection.cs ├── FileDialogFilterBuilder.cs ├── FileDialogFilterBuilderOptions.cs ├── FileNameListView.cs ├── FindProjectsDialog.Designer.cs ├── FindProjectsDialog.cs ├── FindProjectsDialog.resx ├── FolderExclusionsDialog.Designer.cs ├── FolderExclusionsDialog.cs ├── FolderExclusionsDialog.resx ├── GlobalSuppressions.cs ├── Guids.cs ├── ListViewColumnSorter.cs ├── NativeMethods.cs ├── PkgCmdID.cs ├── Properties └── AssemblyInfo.cs ├── Resources ├── Images.png ├── Package.ico └── preview-image.png ├── Utilities.cs ├── VSPackage.Designer.cs ├── VSPackage.resx ├── cyopublic.snk └── source.extension.vsixmanifest /.editorconfig: -------------------------------------------------------------------------------- 1 | ; http://editorconfig.org/ 2 | ; https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328 3 | 4 | root=true 5 | 6 | [*] 7 | end_of_line = crlf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | charset = utf-8 11 | 12 | [*.cs] 13 | indent_style = space 14 | indent_size = 2 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | nuget/ 2 | builds/ 3 | _NCrunch*/ 4 | .vs/ 5 | bin/ 6 | obj/ 7 | 8 | optimizeimages.bat 9 | *.ncrunchsolution 10 | *.ncrunchproject 11 | build.cmd 12 | build.vs2017.cmd 13 | *.user 14 | *.suo 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 1.0.8.2 4 | 5 | ### Added 6 | 7 | * Visual Studio 2022 support 8 | 9 | ## 1.0.8.1 10 | 11 | ### Added 12 | 13 | * Missing projects are now highlighted in the list (this was 14 | previously only available in debug builds) 15 | 16 | ### Fixed 17 | 18 | * Default filters were continuously being duplicated 19 | * Clicking OK in the Add Projects Dialog now continues even if 20 | no projects were selected to add (e.g. it saves any setting 21 | changes) 22 | 23 | ## 1.0.8.0 24 | 25 | ### Added 26 | 27 | * Added support for Visual Studio 2019 28 | 29 | ## 1.0.7.0 30 | 31 | ### Added 32 | 33 | * Added support for Visual Studio 2017 34 | 35 | ## 1.0.6.0 36 | 37 | ### Added 38 | 39 | * Added the ability to customize the file dialog filters 40 | * Added Nuget projects (*.nuproj) as a default file filter 41 | * Added the ability to configure settings via the main dialog 42 | 43 | ### Removed 44 | 45 | * Removed manifest support for older versions of Visual Studio, 46 | this was broken by an earlier update that upgraded to use the 47 | Visual Studio 2015 SDK. For Visual Studio 2013 support, you 48 | can 49 | [download]() 50 | an older version 51 | 52 | ### Fixed 53 | 54 | * Correctly a duplicate accelerator in the main window 55 | 56 | ## 1.0.5.0 57 | 58 | ### Added 59 | 60 | * Added the ability to exclude folders such as 61 | `bower_components`, `node_modules`, `bin`, `obj` etc from 62 | being automatically scanned 63 | 64 | ### Changed 65 | 66 | * Improved error messages when a project cannot be added as the 67 | source file can no longer be found 68 | 69 | ## 1.0.4.0 70 | 71 | ### Changed 72 | 73 | * Improved the performance of searching folders for projects 74 | [[#2]](https://github.com/cyotek/Cyotek.AddProjects/issues/2) 75 | * Changed .NET dependency to be 4.5 or higher, instead of being 76 | fixed to 4.5 only 77 | [[#1]](https://github.com/cyotek/Cyotek.AddProjects/issues/1) 78 | 79 | ## 1.0.3.0 80 | 81 | ### Changed 82 | 83 | * Updated Add File browse dialog to include VB, C#, F# and VC++ 84 | projects 85 | * When adding a new project to the dialog, the project list 86 | automatically scrolls to the new item 87 | * The main project list now greys out projects which are already 88 | a part of your solution 89 | * The Add Folder button now displays an interim dialog so that 90 | you can selected which projects you want to add the list, 91 | instead of blanket adding all matches then requiring you to 92 | remove anything you don't want 93 | * Project list now includes an extension column so you can sort 94 | by project type 95 | 96 | ### Fixed 97 | 98 | * The link label for cyotek.com now correctly moves when the 99 | dialog is resized 100 | 101 | ## 1.0.2.0 102 | 103 | ### Added 104 | 105 | * Added basic sorting to the project list. No GUI indicators 106 | though, sorry. 107 | 108 | ## 1.0.1.0 109 | 110 | ### Added 111 | 112 | * "Add Project" dialog now allows multiple selections 113 | * Added the ability to filter the project list via a regular 114 | expression 115 | 116 | ## 1.0.0.0 117 | 118 | * Initial release 119 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | Contributors 2 | ============ 3 | 4 | Cyotek thanks the following people for contributing to this project: 5 | 6 | * **@holycrepe** for adding the ability to customize the projects filter rather than the basic hard-coded list I initial had 7 | -------------------------------------------------------------------------------- /Cyotek.VisualStudioExtensions.AddProjects.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2002 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{FEA59952-CC14-40A8-85D8-B897601074F8}" 7 | ProjectSection(SolutionItems) = preProject 8 | CHANGELOG.md = CHANGELOG.md 9 | CONTRIBUTORS.md = CONTRIBUTORS.md 10 | LICENSE.txt = LICENSE.txt 11 | README.md = README.md 12 | EndProjectSection 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cyotek.VisualStudioExtensions.AddProjects.2019", "src\Cyotek.VisualStudioExtensions.AddProjects.csproj", "{A2EBDF4C-FB22-464B-AB34-4ED9EB38F0E1}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {A2EBDF4C-FB22-464B-AB34-4ED9EB38F0E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {A2EBDF4C-FB22-464B-AB34-4ED9EB38F0E1}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {A2EBDF4C-FB22-464B-AB34-4ED9EB38F0E1}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {A2EBDF4C-FB22-464B-AB34-4ED9EB38F0E1}.Release|Any CPU.Build.0 = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(ExtensibilityGlobals) = postSolution 31 | SolutionGuid = {BA80B475-96B7-437F-BB0B-0A9249C7A1CB} 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2022 Cyotek Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cyotek Add Existing Projects Visual Studio Extension 2 | 3 | ## Source and Support 4 | 5 | [Source][source] | [Issues][issues] 6 | 7 | ## Background 8 | 9 | My solutions used have lots of references to other projects as I 10 | would load common code as source code libraries. When creating a 11 | new solution (or retro-fitting an existing solution to use new 12 | libraries), I would end up using **File | Add | Existing 13 | project** _a lot_. As I was curious about how extensions in 14 | Visual Studio worked, I decided to write a very simple one to 15 | ease the grunt work of adding multiple common projects. 16 | 17 | This simple extension, originally created for Visual Studio 2012 18 | as I recall, is the result. I'm afraid it doesn't use WPF, so 19 | it's a touch ugly but it gets the job done. 20 | 21 | Note that in the intervening years I finally converted almost 22 | 100 common library projects into proper NuGet packages and so I 23 | haven't actually needed this extension for some time. As some 24 | people find it useful I tend to create a new version for each 25 | new version of Visual Studio but that's about it at the moment - 26 | the extension isn't really actively developed. 27 | 28 | ## Using the extension 29 | 30 | ![Accessing the extension][menuscreen] 31 | 32 | To use the extension, open the **Tools** menu and choose **Add 33 | Projects**. This will open a lovely unthemed Windows Forms 34 | dialogue containing a list of projects that can be automatically 35 | added. 36 | 37 | Projects are colour coded as follows 38 | 39 | * Black - no particular status 40 | * Grey - the project is already part of the active solution 41 | * Red - the source project cannot be found 42 | 43 | Note that the first time you open this dialogue, the list will be 44 | empty - the MRU must be populated by yourself. 45 | 46 | ![The main project window][mainscreen] 47 | 48 | Check each project you want to add to your solution, then click 49 | the **OK** button. It will then try and add each selected 50 | project to your solution, skipping any that are already present. 51 | 52 | You can limit the projects displayed in the list by entering 53 | text into the **Filter** field. This filter text can be a 54 | regular expression and is matched on the entire filename, 55 | including the path. 56 | 57 | ### Configuring settings 58 | 59 | ![The setting dialogue][settingsscreen] 60 | 61 | The settings dialog allows you to configure folder exclusions 62 | used by the **Find Projects** dialogue (for example you probably 63 | don't want to scan `node_modules`) and the project types used by 64 | both the **Find Projects** dialog and the manual file browser 65 | dialogue. 66 | 67 | To display the settings dialog, click **Settings** from the main 68 | window. 69 | 70 | #### Configuring folder exclusions 71 | 72 | Enter the names of any folders you want to exclude from 73 | automatic scanning, one per line. These matches are a simple 74 | text match on a full path, so use directory separators to avoid 75 | partial matches - e.g. `\bin\` to ignore all folders named 76 | `bin`, but not folders that contain `bin`. 77 | 78 | #### Configuring project types 79 | 80 | Enter a simple description and file mask for each type, one type 81 | per line. Separate the description and mask with the pipe (`|`) 82 | character. Multiple masks can be used, separate each with a 83 | semi-colon (`;`). 84 | 85 | See the [Filter][filedialogfilter] property documentation for 86 | the `FileDialog` class for more information on this method of 87 | specifying filter options. 88 | 89 | ### Adding a single project to the MRU 90 | 91 | To add a single project to the list, click the **Add File** 92 | button then select the project you want to include. 93 | 94 | > Note: Currently changes won't be saved unless you click **OK** 95 | > from this dialogue, _or_ click the **Settings** button and then 96 | > click **OK** from the Settings dialogue. 97 | 98 | ### Adding multiple projects to the MRU 99 | 100 | ![Scanning a folder for projects][addfolderscreen] 101 | 102 | To add multiple projects to the list, click the **Add Folder** 103 | button, then select a folder. The folder (and its sub folders) 104 | will then be scanned for any projects not already in the main 105 | MRU. Tick the projects you want to add, then click **OK** to update 106 | the main list. 107 | 108 | ### Removing projects from the MRU 109 | 110 | To remove projects from the MRU, select one or more projects, 111 | click the **Remove button** and then confirm the removal. 112 | 113 | > Note: Currently changes won't be saved unless you click **OK** 114 | > from this dialogue, _or_ click the **Settings** button and then 115 | > click **OK** from the Settings dialogue. 116 | 117 | ## Configuration Settings 118 | 119 | The settings for the extension are saved into an XML file 120 | located at 121 | `%AppData%\Cyotek\VisualStudioExtensions\AddProjects\config.xml`. 122 | 123 | ```xml 124 | 125 | 126 | 127 | \bower_components\ 128 | \node_modules\ 129 | \bin\ 130 | \obj\ 131 | 132 | 133 | C# Projects|*.csproj 134 | Visual Basic Projects|*.vbproj 135 | C++ Projects|*.vcproj;*.vcxproj 136 | F# Projects|*.fsproj 137 | NuGet Packager Projects|*.nuproj 138 | 139 | 140 | C:\Checkout\cyotek\source\Libraries\Cyotek.ApplicationServices\Cyotek.ApplicationServices.csproj 141 | C:\Checkout\cyotek\source\Libraries\Cyotek.ApplicationServices.Commands\Cyotek.ApplicationServices.Commands.csproj 142 | 143 | C:\Checkout\cyotek\source\Libraries\Cyotek.Windows.Runtime.Support\Cyotek.Windows.Runtime.Support.csproj 144 | C:\Checkout\cyotek\source\Libraries\Cyotek.Windows.Runtime.Testing\Cyotek.Windows.Runtime.Testing.csproj 145 | 146 | 147 | ``` 148 | 149 | The `Projects` element stores the MRU list of projects. 150 | 151 | The `ExcludedFolders` element stores a list of folder names to 152 | ignore when automatically scanning a folder tree, for example 153 | `node_modules`. 154 | 155 | The `ProjectTypes` element stores a set of filters that are used 156 | by file and folder dialogues. 157 | 158 | ## Known Issues 159 | 160 | These are the issues I currently know about - please let me know 161 | if you find anything else. 162 | 163 | * The extension is using Windows Forms instead of WPF, so it 164 | won't theme with VS 165 | * There's little error handling and it's not hooked up with the 166 | normal automatic error submission library I use. So if it 167 | crashes, it won't tell me automatically (so please raise an 168 | issue if it does!) 169 | * As I already mentioned, if you make changes to the core 170 | project list, it will only save it you select something to add 171 | to your solution. 172 | * It doesn't honour the current selection in the Project 173 | Explorer. For example, if you create and select a Solution 174 | Folder, using File | Add | Existing Project will add the 175 | project as a child. This extension won't, as by the time I'd 176 | finished writing it I could have filled several swear jars 177 | * The source code is awful, but it does work 178 | * It was written for an older version of Visual Studio. While it 179 | was updated slightly to support the new async model in 2019, I 180 | have no idea if it follows best practices for extensions 181 | * It can be a bit slow when adding lots of projects. I never did 182 | get around to seeing if it was possible to batch add projects 183 | to Visual Studio... it is still far quicker than doing it by 184 | hand 185 | 186 | More information can be found on the [Cyotek Blog][blog]. 187 | 188 | ## Change Log 189 | 190 | Please view the change log for this extension on the 191 | [GitHub][source] page for this project. 192 | 193 | ## Installing the extension 194 | 195 | When newer versions of Visual Studio were released, I discovered 196 | I couldn't compile the extension to support both the previous 197 | version(s) and the new... no doubt it is possible, but I wasn't 198 | willing to devote the time to it back then, and am even less so 199 | now. 200 | 201 | * [Visual Studio 2012][vs2015dl] (Actually, I can't remember 202 | what version this particular download supports. It claims to 203 | support 2012 onwards, but this is an error in how I defined 204 | the manifest) 205 | * [Visual Studio 2017][vs2017dl] 206 | * [Visual Studio 2019][vs2019dl] 207 | * [Visual Studio 2022][vs2022dl] 208 | 209 | ## Debugging the extension 210 | 211 | Unlike with previous versions of Visual Studio, with VS2022 you 212 | can simply start debugging without having to make manual changes 213 | to the debug configuration - it will automatically open in the 214 | "Experimental" Visual Studio instance. You will need the Visual 215 | Studio 2022 SDK however. If this isn't already installed, Visual 216 | Studio will automatically prompt to install upon opening the 217 | solution. 218 | 219 | ## License 220 | 221 | The Add Existing Projects extension is licensed under the MIT 222 | License. See `LICENSE.txt` for the full text. 223 | 224 | [source]: https://github.com/cyotek/Cyotek.AddProjects 225 | [issues]: https://github.com/cyotek/Cyotek.AddProjects/issues 226 | [blog]: https://www.cyotek.com/blog/tag/vsix 227 | 228 | [vs2015dl]: https://marketplace.visualstudio.com/items?itemName=RichardJMoss.AddExistingProjects 229 | [vs2017dl]: https://marketplace.visualstudio.com/items?itemName=RichardJMoss.AddExistingProjects-19444 230 | [vs2019dl]: https://github.com/cyotek/Cyotek.AddProjects/releases/tag/1.0.8.1 231 | [vs2022dl]: https://marketplace.visualstudio.com/items?itemName=cyotek.cyotekaddprojectsvs2022 232 | 233 | [filedialogfilter]: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog.filter?view=windowsdesktop-6.0#remarks 234 | 235 | [menuscreen]: res/addprojects-menu.png 236 | [mainscreen]: res/addprojects-main.png 237 | [addfolderscreen]: res/addprojects-findprojects.png 238 | [settingsscreen]: res/addprojects-settings.png 239 | -------------------------------------------------------------------------------- /res/Images.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/Images.pdn -------------------------------------------------------------------------------- /res/addprojects-findprojects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/addprojects-findprojects.png -------------------------------------------------------------------------------- /res/addprojects-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/addprojects-main.png -------------------------------------------------------------------------------- /res/addprojects-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/addprojects-menu.png -------------------------------------------------------------------------------- /res/addprojects-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/addprojects-settings.png -------------------------------------------------------------------------------- /res/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-16.png -------------------------------------------------------------------------------- /res/icon-196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-196.png -------------------------------------------------------------------------------- /res/icon-24.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-24.pdn -------------------------------------------------------------------------------- /res/icon-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-24.png -------------------------------------------------------------------------------- /res/icon-256.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-256.pdn -------------------------------------------------------------------------------- /res/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-256.png -------------------------------------------------------------------------------- /res/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-32.png -------------------------------------------------------------------------------- /res/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-48.png -------------------------------------------------------------------------------- /res/icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-64.png -------------------------------------------------------------------------------- /res/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/res/icon-72.png -------------------------------------------------------------------------------- /src/AddProjectsDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cyotek.VisualStudioExtensions.AddProjects 2 | { 3 | partial class AddProjectsDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.Windows.Forms.Label projectsLabel; 33 | System.Windows.Forms.Label filterLabel; 34 | this.projectsListView = new Cyotek.VisualStudioExtensions.AddProjects.FileNameListView(); 35 | this.addFileButton = new System.Windows.Forms.Button(); 36 | this.addFolderButton = new System.Windows.Forms.Button(); 37 | this.okButton = new System.Windows.Forms.Button(); 38 | this.cancelButton = new System.Windows.Forms.Button(); 39 | this.removeButton = new System.Windows.Forms.Button(); 40 | this.filterTextBox = new System.Windows.Forms.TextBox(); 41 | this.updateFilterTimer = new System.Windows.Forms.Timer(this.components); 42 | this.toolTip = new System.Windows.Forms.ToolTip(this.components); 43 | this.homeLinkLabel = new System.Windows.Forms.LinkLabel(); 44 | this.settingsButton = new System.Windows.Forms.Button(); 45 | projectsLabel = new System.Windows.Forms.Label(); 46 | filterLabel = new System.Windows.Forms.Label(); 47 | this.SuspendLayout(); 48 | // 49 | // projectsLabel 50 | // 51 | projectsLabel.AutoSize = true; 52 | projectsLabel.Location = new System.Drawing.Point(9, 22); 53 | projectsLabel.Name = "projectsLabel"; 54 | projectsLabel.Size = new System.Drawing.Size(224, 13); 55 | projectsLabel.TabIndex = 0; 56 | projectsLabel.Text = "Select the &projects to add the current solution:"; 57 | // 58 | // projectsListView 59 | // 60 | this.projectsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 61 | | System.Windows.Forms.AnchorStyles.Left) 62 | | System.Windows.Forms.AnchorStyles.Right))); 63 | this.projectsListView.CheckBoxes = true; 64 | this.projectsListView.FullRowSelect = true; 65 | this.projectsListView.Location = new System.Drawing.Point(12, 38); 66 | this.projectsListView.Name = "projectsListView"; 67 | this.projectsListView.ShowItemToolTips = true; 68 | this.projectsListView.Size = new System.Drawing.Size(660, 345); 69 | this.projectsListView.TabIndex = 1; 70 | this.projectsListView.UseCompatibleStateImageBehavior = false; 71 | this.projectsListView.View = System.Windows.Forms.View.Details; 72 | this.projectsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.projectsListView_ItemChecked); 73 | this.projectsListView.SelectedIndexChanged += new System.EventHandler(this.projectsListView_SelectedIndexChanged); 74 | this.projectsListView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.projectsListView_KeyUp); 75 | // 76 | // addFileButton 77 | // 78 | this.addFileButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 79 | this.addFileButton.Location = new System.Drawing.Point(678, 38); 80 | this.addFileButton.Name = "addFileButton"; 81 | this.addFileButton.Size = new System.Drawing.Size(94, 23); 82 | this.addFileButton.TabIndex = 4; 83 | this.addFileButton.Text = "&Add File..."; 84 | this.toolTip.SetToolTip(this.addFileButton, "Add projects from a single folder"); 85 | this.addFileButton.UseVisualStyleBackColor = true; 86 | this.addFileButton.Click += new System.EventHandler(this.addFileButton_Click); 87 | // 88 | // addFolderButton 89 | // 90 | this.addFolderButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 91 | this.addFolderButton.Location = new System.Drawing.Point(678, 67); 92 | this.addFolderButton.Name = "addFolderButton"; 93 | this.addFolderButton.Size = new System.Drawing.Size(94, 23); 94 | this.addFolderButton.TabIndex = 5; 95 | this.addFolderButton.Text = "Add &Folder..."; 96 | this.toolTip.SetToolTip(this.addFolderButton, "Add all projects in a folder and its children"); 97 | this.addFolderButton.UseVisualStyleBackColor = true; 98 | this.addFolderButton.Click += new System.EventHandler(this.addFolderButton_Click); 99 | // 100 | // okButton 101 | // 102 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 103 | this.okButton.Location = new System.Drawing.Point(616, 389); 104 | this.okButton.Name = "okButton"; 105 | this.okButton.Size = new System.Drawing.Size(75, 23); 106 | this.okButton.TabIndex = 8; 107 | this.okButton.Text = "OK"; 108 | this.okButton.UseVisualStyleBackColor = true; 109 | this.okButton.Click += new System.EventHandler(this.okButton_Click); 110 | // 111 | // cancelButton 112 | // 113 | this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 114 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 115 | this.cancelButton.Location = new System.Drawing.Point(697, 389); 116 | this.cancelButton.Name = "cancelButton"; 117 | this.cancelButton.Size = new System.Drawing.Size(75, 23); 118 | this.cancelButton.TabIndex = 9; 119 | this.cancelButton.Text = "Cancel"; 120 | this.cancelButton.UseVisualStyleBackColor = true; 121 | this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 122 | // 123 | // removeButton 124 | // 125 | this.removeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 126 | this.removeButton.Enabled = false; 127 | this.removeButton.Location = new System.Drawing.Point(678, 96); 128 | this.removeButton.Name = "removeButton"; 129 | this.removeButton.Size = new System.Drawing.Size(94, 23); 130 | this.removeButton.TabIndex = 6; 131 | this.removeButton.Text = "&Remove..."; 132 | this.toolTip.SetToolTip(this.removeButton, "Remove the selected projects"); 133 | this.removeButton.UseVisualStyleBackColor = true; 134 | this.removeButton.Click += new System.EventHandler(this.removeButton_Click); 135 | // 136 | // filterLabel 137 | // 138 | filterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 139 | filterLabel.AutoSize = true; 140 | filterLabel.Location = new System.Drawing.Point(424, 15); 141 | filterLabel.Name = "filterLabel"; 142 | filterLabel.Size = new System.Drawing.Size(32, 13); 143 | filterLabel.TabIndex = 2; 144 | filterLabel.Text = "F&ilter:"; 145 | // 146 | // filterTextBox 147 | // 148 | this.filterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 149 | this.filterTextBox.Location = new System.Drawing.Point(462, 12); 150 | this.filterTextBox.Name = "filterTextBox"; 151 | this.filterTextBox.Size = new System.Drawing.Size(210, 20); 152 | this.filterTextBox.TabIndex = 3; 153 | this.toolTip.SetToolTip(this.filterTextBox, "Enter a regular expression to filter the project list"); 154 | this.filterTextBox.TextChanged += new System.EventHandler(this.filterTextBox_TextChanged); 155 | // 156 | // updateFilterTimer 157 | // 158 | this.updateFilterTimer.Tick += new System.EventHandler(this.updateFilterTimer_Tick); 159 | // 160 | // homeLinkLabel 161 | // 162 | this.homeLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 163 | this.homeLinkLabel.AutoSize = true; 164 | this.homeLinkLabel.Location = new System.Drawing.Point(9, 394); 165 | this.homeLinkLabel.Name = "homeLinkLabel"; 166 | this.homeLinkLabel.Size = new System.Drawing.Size(89, 13); 167 | this.homeLinkLabel.TabIndex = 10; 168 | this.homeLinkLabel.TabStop = true; 169 | this.homeLinkLabel.Text = "www.cyotek.com"; 170 | this.toolTip.SetToolTip(this.homeLinkLabel, "Visit www.cyotek.com"); 171 | this.homeLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.homeLinkLabel_LinkClicked); 172 | // 173 | // settingsButton 174 | // 175 | this.settingsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 176 | this.settingsButton.Location = new System.Drawing.Point(678, 131); 177 | this.settingsButton.Margin = new System.Windows.Forms.Padding(3, 9, 3, 3); 178 | this.settingsButton.Name = "settingsButton"; 179 | this.settingsButton.Size = new System.Drawing.Size(94, 23); 180 | this.settingsButton.TabIndex = 7; 181 | this.settingsButton.Text = "&Settings..."; 182 | this.toolTip.SetToolTip(this.settingsButton, "Remove the selected projects"); 183 | this.settingsButton.UseVisualStyleBackColor = true; 184 | this.settingsButton.Click += new System.EventHandler(this.settingsButton_Click); 185 | // 186 | // AddProjectsDialog 187 | // 188 | this.AcceptButton = this.okButton; 189 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 190 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 191 | this.CancelButton = this.cancelButton; 192 | this.ClientSize = new System.Drawing.Size(784, 424); 193 | this.Controls.Add(this.settingsButton); 194 | this.Controls.Add(this.homeLinkLabel); 195 | this.Controls.Add(this.filterTextBox); 196 | this.Controls.Add(filterLabel); 197 | this.Controls.Add(this.removeButton); 198 | this.Controls.Add(this.cancelButton); 199 | this.Controls.Add(this.okButton); 200 | this.Controls.Add(this.addFolderButton); 201 | this.Controls.Add(this.addFileButton); 202 | this.Controls.Add(this.projectsListView); 203 | this.Controls.Add(projectsLabel); 204 | this.Name = "AddProjectsDialog"; 205 | this.Text = "Add Existing Projects"; 206 | this.ResumeLayout(false); 207 | this.PerformLayout(); 208 | 209 | } 210 | 211 | #endregion 212 | private FileNameListView projectsListView; 213 | private System.Windows.Forms.Button addFileButton; 214 | private System.Windows.Forms.Button addFolderButton; 215 | private System.Windows.Forms.Button okButton; 216 | private System.Windows.Forms.Button cancelButton; 217 | private System.Windows.Forms.Button removeButton; 218 | private System.Windows.Forms.TextBox filterTextBox; 219 | private System.Windows.Forms.Timer updateFilterTimer; 220 | private System.Windows.Forms.ToolTip toolTip; 221 | private System.Windows.Forms.LinkLabel homeLinkLabel; 222 | private System.Windows.Forms.Button settingsButton; 223 | } 224 | } -------------------------------------------------------------------------------- /src/AddProjectsDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Text.RegularExpressions; 9 | using System.Windows.Forms; 10 | using Microsoft.VisualStudio; 11 | using Microsoft.VisualStudio.Shell; 12 | using Microsoft.VisualStudio.Shell.Interop; 13 | 14 | namespace Cyotek.VisualStudioExtensions.AddProjects 15 | { 16 | internal partial class AddProjectsDialog : BaseForm 17 | { 18 | #region Constants 19 | 20 | private readonly IVsSolution _currentSolution; 21 | 22 | #endregion 23 | 24 | #region Fields 25 | 26 | private FileDialogFilterBuilder _filter; 27 | 28 | private List _loadedProjects; 29 | 30 | private ExtensionSettings _settings; 31 | 32 | private string _settingsFileName; 33 | 34 | #endregion 35 | 36 | #region Constructors 37 | 38 | public AddProjectsDialog() 39 | { 40 | this.InitializeComponent(); 41 | } 42 | 43 | public AddProjectsDialog(IVsSolution solution) 44 | : this() 45 | { 46 | _currentSolution = solution; 47 | } 48 | 49 | #endregion 50 | 51 | #region Methods 52 | 53 | protected override void OnLoad(EventArgs e) 54 | { 55 | ThreadHelper.ThrowIfNotOnUIThread(); 56 | 57 | base.OnLoad(e); 58 | 59 | this.LoadSettings(); 60 | this.PopulateLoadedProjectsList(); 61 | this.UpdateFilteredList(); 62 | 63 | if (projectsListView.Items.Count != 0) 64 | { 65 | projectsListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); 66 | } 67 | } 68 | 69 | private void addFileButton_Click(object sender, EventArgs e) 70 | { 71 | this.EnsureFilterCreated(); 72 | 73 | using (OpenFileDialog dialog = new OpenFileDialog 74 | { 75 | Filter = _filter.ToString(), 76 | DefaultExt = "csproj", // TODO: Calculate this based on the filter 77 | Title = "Add Project", 78 | Multiselect = true 79 | }) 80 | { 81 | if (dialog.ShowDialog(this) == DialogResult.OK) 82 | { 83 | this.AddFilesToMru(dialog.FileNames); 84 | } 85 | } 86 | } 87 | 88 | private void AddFilesToMru(string[] fileNames) 89 | { 90 | this.BeginAction(); 91 | projectsListView.BeginUpdate(); 92 | 93 | foreach (string fileName in fileNames) 94 | { 95 | this.AddProjectToMru(fileName); 96 | } 97 | 98 | projectsListView.EndUpdate(); 99 | this.EndAction(); 100 | } 101 | 102 | private void addFolderButton_Click(object sender, EventArgs e) 103 | { 104 | using (FindProjectsDialog dialog = new FindProjectsDialog(_settings)) 105 | { 106 | if (dialog.ShowDialog() == DialogResult.OK) 107 | { 108 | this.AddFilesToMru(dialog.FileNames); 109 | } 110 | } 111 | } 112 | 113 | private ListViewItem AddProjectItem(string fileName, bool isChecked) 114 | { 115 | ListViewItem item; 116 | bool alreadyLoaded; 117 | 118 | alreadyLoaded = _loadedProjects.Contains(fileName); 119 | 120 | item = projectsListView.AddFile(fileName, isChecked); 121 | 122 | if (alreadyLoaded) 123 | { 124 | this.MarkProjectAsLoaded(item); 125 | } 126 | else if (!File.Exists(fileName)) 127 | { 128 | this.MarkProjectAsNotFound(item); 129 | } 130 | else 131 | { 132 | item.Tag = false; 133 | } 134 | 135 | return item; 136 | } 137 | 138 | private void AddProjectToMru(string fileName) 139 | { 140 | if (!_settings.Projects.Contains(fileName, StringComparer.InvariantCultureIgnoreCase)) 141 | { 142 | _settings.Projects.Add(fileName); 143 | this.AddProjectItem(fileName, true).EnsureVisible(); 144 | } 145 | } 146 | 147 | private void cancelButton_Click(object sender, EventArgs e) 148 | { 149 | this.DialogResult = DialogResult.Cancel; 150 | this.Close(); 151 | } 152 | 153 | private void EnsureFilterCreated() 154 | { 155 | if (_filter == null) 156 | { 157 | _filter = Utilities.GetProjectsFilter(_settings.ProjectTypes); 158 | } 159 | } 160 | 161 | private void filterTextBox_TextChanged(object sender, EventArgs e) 162 | { 163 | updateFilterTimer.Stop(); 164 | updateFilterTimer.Start(); 165 | } 166 | 167 | private IEnumerable GetSolutionProjects() 168 | { 169 | IEnumHierarchies enumerator; 170 | Guid guid = Guid.Empty; 171 | IVsHierarchy[] hierarchy; 172 | uint fetched; 173 | 174 | ThreadHelper.ThrowIfNotOnUIThread(); 175 | 176 | // http://stackoverflow.com/a/304376/148962 177 | 178 | _currentSolution.GetProjectEnum((uint)__VSENUMPROJFLAGS.EPF_LOADEDINSOLUTION, ref guid, out enumerator); 179 | 180 | hierarchy = new IVsHierarchy[] 181 | { 182 | null 183 | }; 184 | 185 | for (enumerator.Reset(); enumerator.Next(1, hierarchy, out fetched) == VSConstants.S_OK && fetched == 1;) 186 | { 187 | yield return (IVsProject)hierarchy[0]; 188 | } 189 | } 190 | 191 | private void homeLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 192 | { 193 | try 194 | { 195 | Process.Start("http://www.cyotek.com/"); 196 | } 197 | catch (Exception ex) 198 | { 199 | Utilities.ShowExceptionMessage(ex); 200 | } 201 | } 202 | 203 | private void LoadSettings() 204 | { 205 | _settingsFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Cyotek\VisualStudioExtensions\AddProjects\config.xml"); 206 | _settings = ExtensionSettings.Load(_settingsFileName); 207 | } 208 | 209 | private void MarkProjectAsLoaded(ListViewItem item) 210 | { 211 | item.ForeColor = SystemColors.GrayText; 212 | item.ToolTipText = "This project is already in the solution"; 213 | item.Tag = true; 214 | } 215 | 216 | private void MarkProjectAsNotFound(ListViewItem item) 217 | { 218 | item.ForeColor = Color.Firebrick; 219 | item.ToolTipText = "The project file cannot be found"; 220 | } 221 | 222 | private void okButton_Click(object sender, EventArgs e) 223 | { 224 | ThreadHelper.ThrowIfNotOnUIThread(); 225 | 226 | try 227 | { 228 | StringBuilder errors; 229 | 230 | this.BeginAction(); 231 | 232 | _settings.Save(_settingsFileName); 233 | 234 | errors = new StringBuilder(); 235 | 236 | foreach (ListViewItem item in projectsListView.CheckedItems) 237 | { 238 | string fileName; 239 | 240 | fileName = item.Name; 241 | 242 | if (!_loadedProjects.Contains(fileName)) 243 | { 244 | if (!File.Exists(fileName)) 245 | { 246 | errors.AppendLine($"Project file '{fileName}' not found, unable to add to solution.").AppendLine(); 247 | } 248 | else 249 | { 250 | Guid projectType; 251 | Guid projectId; 252 | int result; 253 | IntPtr project; 254 | 255 | projectType = Guid.Empty; 256 | projectId = Guid.Empty; 257 | 258 | result = _currentSolution.CreateProject(ref projectType, fileName, null, null, (uint)(__VSCREATEPROJFLAGS.CPF_OPENFILE | __VSCREATEPROJFLAGS.CPF_SILENT), ref projectId, out project); 259 | 260 | if (result != VSConstants.S_OK) 261 | { 262 | errors.AppendLine($"Failed to add project: {fileName}").AppendLine(); 263 | } 264 | else 265 | { 266 | _loadedProjects.Add(fileName); 267 | this.MarkProjectAsLoaded(item); 268 | } 269 | } 270 | } 271 | } 272 | 273 | this.EndAction(); 274 | 275 | if (errors.Length != 0) 276 | { 277 | MessageBox.Show(errors.ToString(), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); 278 | } 279 | 280 | this.DialogResult = DialogResult.OK; 281 | this.Close(); 282 | } 283 | catch (Exception ex) 284 | { 285 | Utilities.ShowExceptionMessage(ex); 286 | } 287 | } 288 | 289 | private void PopulateLoadedProjectsList() 290 | { 291 | ThreadHelper.ThrowIfNotOnUIThread(); 292 | 293 | _loadedProjects = new List(); 294 | 295 | foreach (IVsProject project in this.GetSolutionProjects()) 296 | { 297 | string fileName; 298 | 299 | project.GetMkDocument((uint)VSConstants.VSITEMID.Root, out fileName); 300 | 301 | if (!string.IsNullOrEmpty(fileName)) 302 | { 303 | _loadedProjects.Add(fileName); 304 | } 305 | } 306 | } 307 | 308 | private void projectsListView_ItemChecked(object sender, ItemCheckedEventArgs e) 309 | { 310 | if (e.Item.Checked) 311 | { 312 | bool projectAlreadyLoaded; 313 | 314 | projectAlreadyLoaded = e.Item.Tag != null && (bool)e.Item.Tag; 315 | 316 | if (projectAlreadyLoaded) 317 | { 318 | e.Item.Checked = false; 319 | } 320 | } 321 | } 322 | 323 | private void projectsListView_KeyUp(object sender, KeyEventArgs e) 324 | { 325 | if (e.KeyCode == Keys.Delete) 326 | { 327 | e.Handled = true; 328 | removeButton.PerformClick(); 329 | } 330 | } 331 | 332 | private void projectsListView_SelectedIndexChanged(object sender, EventArgs e) 333 | { 334 | removeButton.Enabled = projectsListView.SelectedItems.Count != 0; 335 | } 336 | 337 | private void removeButton_Click(object sender, EventArgs e) 338 | { 339 | if (MessageBox.Show("Are you sure you want to remove the selected projects from the list?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 340 | { 341 | List names; 342 | 343 | names = projectsListView.SelectedItems.Cast().Select(i => i.Name).ToList(); 344 | foreach (string name in names) 345 | { 346 | _settings.Projects.Remove(name); 347 | projectsListView.Items.RemoveByKey(name); 348 | } 349 | } 350 | } 351 | 352 | private void settingsButton_Click(object sender, EventArgs e) 353 | { 354 | if (Utilities.ShowSettingsDialog(this, _settings)) 355 | { 356 | _filter = null; 357 | 358 | _settings.Save(_settingsFileName); 359 | } 360 | } 361 | 362 | private void UpdateFilteredList() 363 | { 364 | try 365 | { 366 | Regex expression; 367 | 368 | this.BeginAction(); 369 | projectsListView.BeginUpdate(); 370 | 371 | expression = !string.IsNullOrEmpty(filterTextBox.Text) ? new Regex(filterTextBox.Text, RegexOptions.IgnoreCase | RegexOptions.Singleline) : null; 372 | 373 | projectsListView.Items.Clear(); 374 | 375 | // ReSharper disable once LoopCanBePartlyConvertedToQuery 376 | foreach (string fileName in _settings.Projects) 377 | { 378 | if (expression == null || expression.IsMatch(fileName)) 379 | { 380 | this.AddProjectItem(fileName, false); 381 | } 382 | } 383 | 384 | projectsListView.Sort(); 385 | 386 | projectsListView.EndUpdate(); 387 | this.EndAction(); 388 | } 389 | catch (Exception ex) 390 | { 391 | Utilities.ShowExceptionMessage(ex); 392 | } 393 | } 394 | 395 | private void updateFilterTimer_Tick(object sender, EventArgs e) 396 | { 397 | updateFilterTimer.Stop(); 398 | 399 | this.UpdateFilteredList(); 400 | } 401 | 402 | #endregion 403 | } 404 | } 405 | -------------------------------------------------------------------------------- /src/AddProjectsDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | False 122 | 123 | 124 | 173, 17 125 | 126 | 127 | False 128 | 129 | 130 | 17, 17 131 | 132 | -------------------------------------------------------------------------------- /src/AddProjectsPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Design; 3 | using System.Runtime.InteropServices; 4 | using System.Threading; 5 | using System.Windows.Forms; 6 | using Microsoft.VisualStudio.Shell; 7 | using Microsoft.VisualStudio.Shell.Interop; 8 | using Task = System.Threading.Tasks.Task; 9 | 10 | namespace Cyotek.VisualStudioExtensions.AddProjects 11 | { 12 | /// 13 | /// This is the class that implements the package exposed by this assembly. 14 | /// 15 | /// 16 | /// 17 | /// The minimum requirement for a class to be considered a valid package for Visual Studio 18 | /// is to implement the IVsPackage interface and register itself with the shell. 19 | /// This package uses the helper classes defined inside the Managed Package Framework (MPF) 20 | /// to do it: it derives from the Package class that provides the implementation of the 21 | /// IVsPackage interface and uses the registration attributes defined in the framework to 22 | /// register itself and its components with the shell. These attributes tell the pkgdef creation 23 | /// utility what data to put into .pkgdef file. 24 | /// 25 | /// 26 | /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file. 27 | /// 28 | /// 29 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] 30 | // This attribute is used to register the information needed to show this package 31 | // in the Help/About dialog of Visual Studio. 32 | [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] 33 | // This attribute is needed to let the shell know that this package exposes some menus. 34 | [ProvideMenuResource("Menus.ctmenu", 1)] 35 | [Guid(GuidList.guidCyotek_AddProjectsPkgString)] 36 | public sealed class AddProjectsPackage : AsyncPackage 37 | { 38 | 39 | #region Package Members 40 | 41 | /// 42 | /// Initialization of the package; this method is called right after the package is sited, so this is the place 43 | /// where you can put all the initialization code that rely on services provided by VisualStudio. 44 | /// 45 | /// A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down. 46 | /// A provider for progress updates. 47 | /// A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method. 48 | protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) 49 | { 50 | // When initialized asynchronously, the current thread may be a background thread at this point. 51 | // Do any initialization that requires the UI thread after switching to the UI thread. 52 | await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); 53 | 54 | OleMenuCommandService menuCommandService; 55 | 56 | // Add our command handlers for menu (commands must exist in the .vsct file) 57 | menuCommandService = await this.GetServiceAsync(typeof(IMenuCommandService)).ConfigureAwait(false) as OleMenuCommandService; 58 | if (menuCommandService != null) 59 | { 60 | // Create the command for the menu item. 61 | CommandID menuCommandId; 62 | MenuCommand menuItem; 63 | 64 | menuCommandId = new CommandID(GuidList.guidCyotek_AddProjectsCmdSet, (int)PkgCmdIDList.cmdidCyotekAddProjects); 65 | menuItem = new MenuCommand(this.MenuItemCallback, menuCommandId); 66 | 67 | menuCommandService.AddCommand(menuItem); 68 | } 69 | } 70 | 71 | /// 72 | /// This function is the callback used to execute a command when the a menu item is clicked. 73 | /// See the Initialize method to see how the menu item is associated to this function using 74 | /// the OleMenuCommandService service and the MenuCommand class. 75 | /// 76 | private void MenuItemCallback(object sender, EventArgs e) 77 | { 78 | IVsSolution solution; 79 | 80 | ThreadHelper.ThrowIfNotOnUIThread(); 81 | 82 | solution = this.GetService(typeof(SVsSolution)) as IVsSolution; 83 | 84 | if (solution != null) 85 | { 86 | string solutionDirectory; 87 | string solutionFileName; 88 | string solutionOptions; 89 | 90 | solution.GetSolutionInfo(out solutionDirectory, out solutionFileName, out solutionOptions); 91 | 92 | if (!(string.IsNullOrEmpty(solutionDirectory) || string.IsNullOrEmpty(solutionFileName))) 93 | { 94 | using (AddProjectsDialog dialog = new AddProjectsDialog(solution)) 95 | { 96 | dialog.ShowDialog(); 97 | } 98 | } 99 | else 100 | { 101 | MessageBox.Show("This command can only be used with a saved solution.", "Add Projects", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 102 | } 103 | } 104 | else 105 | { 106 | MessageBox.Show("This command can only be used with an open solution.", "Add Projects", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 107 | } 108 | } 109 | 110 | #endregion 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/BaseForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cyotek.VisualStudioExtensions.AddProjects 2 | { 3 | partial class BaseForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // BaseForm 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.ClientSize = new System.Drawing.Size(284, 261); 38 | this.MaximizeBox = false; 39 | this.MinimizeBox = false; 40 | this.Name = "BaseForm"; 41 | this.ShowIcon = false; 42 | this.ShowInTaskbar = false; 43 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; 44 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 45 | this.ResumeLayout(false); 46 | 47 | } 48 | 49 | #endregion 50 | } 51 | } -------------------------------------------------------------------------------- /src/BaseForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace Cyotek.VisualStudioExtensions.AddProjects 6 | { 7 | public partial class BaseForm : Form 8 | { 9 | #region Constructors 10 | 11 | public BaseForm() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | 16 | #endregion 17 | 18 | #region Methods 19 | 20 | protected void BeginAction() 21 | { 22 | Cursor.Current = Cursors.WaitCursor; 23 | 24 | this.UseWaitCursor = true; 25 | } 26 | 27 | protected void EndAction() 28 | { 29 | Cursor.Current = Cursors.Default; 30 | 31 | this.UseWaitCursor = false; 32 | } 33 | 34 | /// 35 | /// Raises the event. 36 | /// 37 | /// An that contains the event data. 38 | protected override void OnLoad(EventArgs e) 39 | { 40 | base.OnLoad(e); 41 | 42 | if (!this.DesignMode) 43 | { 44 | // TODO: Even though we're not using WPF, surely we can get the VS font settings at the very least? 45 | 46 | this.MinimumSize = this.Size; 47 | this.Font = SystemFonts.DialogFont; 48 | } 49 | } 50 | 51 | #endregion 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/BaseForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /src/Cyotek.AddProjects.vsct: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | 56 | 63 | 64 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/Cyotek.VisualStudioExtensions.AddProjects.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 17.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | Debug 10 | AnyCPU 11 | 2.0 12 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 13 | {A2EBDF4C-FB22-464B-AB34-4ED9EB38F0E1} 14 | Library 15 | Properties 16 | Cyotek.VisualStudioExtensions.AddProjects 17 | Cyotek.VisualStudioExtensions.AddProjects 18 | v4.8 19 | true 20 | true 21 | true 22 | false 23 | false 24 | true 25 | true 26 | Program 27 | $(DevEnvDir)devenv.exe 28 | /rootsuffix Exp 29 | 30 | 31 | true 32 | full 33 | false 34 | bin\Debug\ 35 | DEBUG;TRACE 36 | prompt 37 | 4 38 | AnyCPU 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | AnyCPU 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | AddProjectsDialog.cs 55 | 56 | 57 | 58 | Form 59 | 60 | 61 | BaseForm.cs 62 | 63 | 64 | 65 | 66 | 67 | 68 | Component 69 | 70 | 71 | Form 72 | 73 | 74 | FindProjectsDialog.cs 75 | 76 | 77 | Form 78 | 79 | 80 | FolderExclusionsDialog.cs 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | True 91 | True 92 | VSPackage.resx 93 | 94 | 95 | 96 | 97 | Designer 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 16.2.29116.78 115 | 116 | 117 | 118 | 119 | Menus.ctmenu 120 | 121 | 122 | 123 | 124 | AddProjectsDialog.cs 125 | 126 | 127 | BaseForm.cs 128 | 129 | 130 | FindProjectsDialog.cs 131 | 132 | 133 | FolderExclusionsDialog.cs 134 | 135 | 136 | ResXFileCodeGenerator 137 | VSPackage.Designer.cs 138 | Designer 139 | 140 | 141 | 142 | 143 | res\LICENSE.txt 144 | true 145 | PreserveNewest 146 | 147 | 148 | 149 | true 150 | 151 | 152 | true 153 | 154 | 155 | 156 | 157 | 164 | -------------------------------------------------------------------------------- /src/ExtensionSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Xml.Serialization; 4 | 5 | namespace Cyotek.VisualStudioExtensions.AddProjects 6 | { 7 | [Serializable] 8 | public class ExtensionSettings 9 | { 10 | private ExtensionSettingsProjectCollection _projectTypes; 11 | 12 | public static ExtensionSettingsProjectCollection DefaultProjectTypes = new ExtensionSettingsProjectCollection 13 | { 14 | "C# Projects|*.csproj", 15 | "Visual Basic Projects|*.vbproj", 16 | "C++ Projects|*.vcproj;*.vcxproj", 17 | "F# Projects|*.fsproj", 18 | "NuGet Packager Projects|*.nuproj" 19 | }; 20 | 21 | #region Static Constructors 22 | 23 | static ExtensionSettings() 24 | { 25 | Serializer = new XmlSerializer(typeof(ExtensionSettings)); 26 | } 27 | 28 | #endregion 29 | 30 | #region Constructors 31 | 32 | public ExtensionSettings() 33 | { 34 | this.Projects = new ExtensionSettingsProjectCollection(); 35 | this.ExcludedFolders = new ExtensionSettingsProjectCollection(); 36 | } 37 | 38 | #endregion 39 | 40 | #region Static Properties 41 | 42 | private static XmlSerializer Serializer { get; set; } 43 | 44 | #endregion 45 | 46 | #region Static Methods 47 | 48 | public static ExtensionSettings Load(string fileName) 49 | { 50 | ExtensionSettings settings; 51 | 52 | if (string.IsNullOrEmpty(fileName)) 53 | { 54 | throw new ArgumentNullException(nameof(fileName)); 55 | } 56 | 57 | settings = new ExtensionSettings(); 58 | 59 | if (File.Exists(fileName)) 60 | { 61 | try 62 | { 63 | using (FileStream stream = File.OpenRead(fileName)) 64 | { 65 | settings = (ExtensionSettings)Serializer.Deserialize(stream); 66 | } 67 | } 68 | catch 69 | { 70 | // ignore exceptions 71 | } 72 | } 73 | 74 | if (settings.ProjectTypes.Count == 0) 75 | { 76 | settings.ProjectTypes.AddRange(ExtensionSettings.DefaultProjectTypes); 77 | } 78 | 79 | return settings; 80 | } 81 | 82 | #endregion 83 | 84 | #region Properties 85 | 86 | public ExtensionSettingsProjectCollection ExcludedFolders { get; set; } 87 | 88 | public ExtensionSettingsProjectCollection ProjectTypes 89 | { 90 | get { return _projectTypes ?? (_projectTypes = new ExtensionSettingsProjectCollection()); } 91 | set { _projectTypes = value; } 92 | } 93 | 94 | public ExtensionSettingsProjectCollection Projects { get; set; } 95 | 96 | #endregion 97 | 98 | #region Methods 99 | 100 | public void Save(string fileName) 101 | { 102 | if (string.IsNullOrEmpty(fileName)) 103 | { 104 | throw new ArgumentNullException(nameof(fileName)); 105 | } 106 | 107 | Directory.CreateDirectory(Path.GetDirectoryName(fileName)); 108 | 109 | using (Stream stream = File.Create(fileName)) 110 | { 111 | Serializer.Serialize(stream, this); 112 | } 113 | } 114 | 115 | #endregion 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/ExtensionSettingsProjectCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | 5 | namespace Cyotek.VisualStudioExtensions.AddProjects 6 | { 7 | [Serializable] 8 | public class ExtensionSettingsProjectCollection : Collection 9 | { 10 | #region Methods 11 | 12 | public void AddRange(IEnumerable items) 13 | { 14 | foreach (string item in items) 15 | { 16 | this.Add(item); 17 | } 18 | } 19 | 20 | #endregion 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/FileDialogFilterBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace Cyotek 8 | { 9 | internal sealed class FileDialogFilterBuilder : IEnumerable 10 | { 11 | #region Constants 12 | 13 | private readonly List> _groups; 14 | 15 | #endregion 16 | 17 | #region Constructors 18 | 19 | public FileDialogFilterBuilder() 20 | { 21 | _groups = new List>(); 22 | } 23 | 24 | public FileDialogFilterBuilder(string filter) 25 | : this() 26 | { 27 | this.Add(filter); 28 | } 29 | 30 | #endregion 31 | 32 | #region Static Methods 33 | 34 | public static string Combine(params string[] filters) 35 | { 36 | return Combine(FileDialogFilterBuilderOptions.AddAllFiles | FileDialogFilterBuilderOptions.AddCombined, filters); 37 | } 38 | 39 | public static string Combine(FileDialogFilterBuilderOptions options, params string[] filters) 40 | { 41 | FileDialogFilterBuilder builder; 42 | 43 | builder = new FileDialogFilterBuilder(); 44 | foreach (string filter in filters) 45 | { 46 | builder.Add(filter); 47 | } 48 | 49 | if ((options & FileDialogFilterBuilderOptions.AddAllFiles) != 0) 50 | { 51 | builder.AddAllFiles(); 52 | } 53 | 54 | if ((options & FileDialogFilterBuilderOptions.AddCombined) != 0) 55 | { 56 | builder.AddCombined(); 57 | } 58 | 59 | return builder.ToString(); 60 | } 61 | 62 | private static string SanatizeExtension(string mask) 63 | { 64 | int position; 65 | 66 | position = mask.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase); 67 | if (position != -1) 68 | { 69 | mask = mask.Substring(position + 1); 70 | } 71 | 72 | return mask.Trim(); 73 | } 74 | 75 | private static string SanatizeName(string name) 76 | { 77 | int position; 78 | 79 | position = name.IndexOf("(", StringComparison.InvariantCultureIgnoreCase); 80 | if (position != -1) 81 | { 82 | name = name.Substring(0, position - 1); 83 | } 84 | 85 | return name.Trim(); 86 | } 87 | 88 | #endregion 89 | 90 | #region Properties 91 | 92 | public int Count 93 | { 94 | get { return _groups.Count; } 95 | } 96 | 97 | public string Filter 98 | { 99 | get 100 | { 101 | StringBuilder result; 102 | 103 | result = new StringBuilder(); 104 | 105 | foreach (Tuple pair in _groups) 106 | { 107 | result.Append(pair.Item1); 108 | result.Append("|"); 109 | result.Append(pair.Item2); 110 | result.Append("|"); 111 | } 112 | 113 | if (result.Length != 0) 114 | { 115 | result.Remove(result.Length - 1, 1); 116 | } 117 | 118 | return result.ToString(); 119 | } 120 | } 121 | 122 | public string this[int index] 123 | { 124 | get 125 | { 126 | Tuple item; 127 | 128 | item = _groups[index]; 129 | 130 | return string.Concat(item.Item1, "|", item.Item2); 131 | } 132 | } 133 | 134 | #endregion 135 | 136 | #region Methods 137 | 138 | public void Add(string name, IEnumerable extensions) 139 | { 140 | this.Add(name, extensions, true); 141 | } 142 | 143 | public void Add(string name, IEnumerable extensions, bool expandText) 144 | { 145 | this.Insert(this.Count, name, extensions, expandText); 146 | } 147 | 148 | public void Add(string text, string masks) 149 | { 150 | this.Insert(this.Count, text, masks); 151 | } 152 | 153 | public void Add(string filter) 154 | { 155 | this.Insert(this.Count, filter); 156 | } 157 | 158 | public void AddAllFiles() 159 | { 160 | this.Add("All Files", "*.*"); 161 | } 162 | 163 | public void AddCombined() 164 | { 165 | this.AddCombined("All Supported Files"); 166 | } 167 | 168 | public void AddCombined(string text) 169 | { 170 | List extensions; 171 | 172 | extensions = new List(); 173 | 174 | foreach (string extension in _groups.SelectMany(pair => pair.Item2.Split(new[] 175 | { 176 | ';' 177 | }, StringSplitOptions.RemoveEmptyEntries).Select(SanatizeExtension).Where(extension => extension != "*" && !extensions.Contains(extension)))) 178 | { 179 | extensions.Add(extension); 180 | } 181 | 182 | this.Insert(0, text, extensions.ToArray(), true); 183 | } 184 | 185 | public void Remove(string name) 186 | { 187 | name = SanatizeName(name); 188 | 189 | for (int i = _groups.Count; i > 0; i--) 190 | { 191 | string groupName; 192 | 193 | groupName = _groups[i - 1].Item1; 194 | if (groupName.StartsWith(name, StringComparison.InvariantCultureIgnoreCase)) 195 | { 196 | _groups.RemoveAt(i - 1); 197 | } 198 | } 199 | } 200 | 201 | public override string ToString() 202 | { 203 | return this.Filter; 204 | } 205 | 206 | private void Insert(int index, string name, IEnumerable extensions, bool expandText) 207 | { 208 | string text; 209 | StringBuilder masks; 210 | string mask; 211 | 212 | masks = new StringBuilder(); 213 | 214 | foreach (string extension in extensions) 215 | { 216 | if (masks.Length != 0) 217 | { 218 | masks.Append(';'); 219 | } 220 | 221 | masks.Append('*'); 222 | 223 | if (extension[0] != '.') 224 | { 225 | masks.Append('.'); 226 | } 227 | 228 | masks.Append(extension); 229 | } 230 | 231 | mask = masks.ToString(); 232 | text = expandText ? string.Format("{0} ({1})", name, mask) : name; 233 | 234 | this.Insert(index, text, mask); 235 | } 236 | 237 | private void Insert(int index, string text, string masks) 238 | { 239 | this.Remove(text); 240 | 241 | if (index > this.Count) 242 | { 243 | index = this.Count; 244 | } 245 | 246 | _groups.Insert(index, new Tuple(text, masks)); 247 | } 248 | 249 | private void Insert(int index, string filter) 250 | { 251 | string[] parts; 252 | 253 | parts = filter.Split(new[] 254 | { 255 | '|' 256 | }, StringSplitOptions.RemoveEmptyEntries); 257 | 258 | for (int i = 0; i < parts.Length; i += 2) 259 | { 260 | string text; 261 | string[] masks; 262 | string[] extensions; 263 | 264 | text = SanatizeName(parts[i]); 265 | masks = parts[i + 1].Split(new[] 266 | { 267 | ';' 268 | }, StringSplitOptions.RemoveEmptyEntries); 269 | extensions = masks.Select(SanatizeExtension).ToArray(); 270 | 271 | this.Insert(index, text, extensions, true); 272 | index++; 273 | } 274 | } 275 | 276 | #endregion 277 | 278 | #region IEnumerable Interface 279 | 280 | public IEnumerator GetEnumerator() 281 | { 282 | for (int i = 0; i < this.Count; i++) 283 | { 284 | yield return this[i]; 285 | } 286 | } 287 | 288 | IEnumerator IEnumerable.GetEnumerator() 289 | { 290 | return this.GetEnumerator(); 291 | } 292 | 293 | #endregion 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /src/FileDialogFilterBuilderOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Cyotek 4 | { 5 | [Flags] 6 | internal enum FileDialogFilterBuilderOptions 7 | { 8 | None = 0, 9 | 10 | AddAllFiles = 1, 11 | 12 | AddCombined = 2 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/FileNameListView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Windows.Forms; 4 | 5 | namespace Cyotek.VisualStudioExtensions.AddProjects 6 | { 7 | internal class FileNameListView : ListView 8 | { 9 | #region Fields 10 | 11 | private ListViewColumnSorter _listViewColumnSorter; 12 | 13 | #endregion 14 | 15 | #region Constructors 16 | 17 | public FileNameListView() 18 | { 19 | this.View = View.Details; 20 | this.FullRowSelect = true; 21 | this.ShowItemToolTips = true; 22 | this.InitializeSorting(); 23 | } 24 | 25 | #endregion 26 | 27 | #region Methods 28 | 29 | public ListViewItem AddFile(string fileName, bool autoCheck) 30 | { 31 | ListViewItem item; 32 | 33 | item = this.CreateListViewItem(fileName); 34 | item.Checked = autoCheck; 35 | 36 | this.Items.Add(item); 37 | 38 | return item; 39 | } 40 | 41 | /// 42 | /// Raises the event. 43 | /// 44 | /// A that contains the event data. 45 | protected override void OnColumnClick(ColumnClickEventArgs e) 46 | { 47 | if (e.Column == _listViewColumnSorter.SortColumn) 48 | { 49 | _listViewColumnSorter.SortOrder = _listViewColumnSorter.SortOrder == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending; 50 | } 51 | else 52 | { 53 | _listViewColumnSorter.SortColumn = e.Column; 54 | _listViewColumnSorter.SortOrder = SortOrder.Ascending; 55 | } 56 | 57 | this.Sort(); 58 | 59 | base.OnColumnClick(e); 60 | } 61 | 62 | /// 63 | /// Raises the method. 64 | /// 65 | protected override void OnCreateControl() 66 | { 67 | base.OnCreateControl(); 68 | 69 | if (!this.DesignMode) 70 | { 71 | this.AddColumnHeaders(); 72 | } 73 | } 74 | 75 | protected override void OnHandleCreated(EventArgs e) 76 | { 77 | base.OnHandleCreated(e); 78 | 79 | if (!this.DesignMode && Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6) 80 | { 81 | NativeMethods.SetWindowTheme(this.Handle, "explorer", null); 82 | } 83 | } 84 | 85 | private void AddColumnHeaders() 86 | { 87 | if (this.Columns.Count == 0) 88 | { 89 | this.Columns.Add(new ColumnHeader 90 | { 91 | Name = "nameColumnHeader", 92 | Text = "Name", 93 | Width = 120 94 | }); 95 | 96 | this.Columns.Add(new ColumnHeader 97 | { 98 | Name = "extensionColumnHeader", 99 | Text = "Extension", 100 | Width = 90 101 | }); 102 | 103 | this.Columns.Add(new ColumnHeader 104 | { 105 | Name = "pathColumnHeader", 106 | Text = "Path", 107 | Width = 360 108 | }); 109 | } 110 | } 111 | 112 | private ListViewItem CreateListViewItem(string fileName) 113 | { 114 | ListViewItem item; 115 | string extension; 116 | 117 | extension = Path.GetExtension(fileName); 118 | if (!string.IsNullOrEmpty(extension) && extension[0] == '.') 119 | { 120 | extension = extension.Remove(0, 1); 121 | } 122 | 123 | item = new ListViewItem(); 124 | item.Name = fileName; 125 | item.Text = Path.GetFileName(fileName); 126 | item.SubItems.Add(extension); 127 | item.SubItems.Add(Path.GetDirectoryName(fileName)); 128 | 129 | return item; 130 | } 131 | 132 | private void InitializeSorting() 133 | { 134 | _listViewColumnSorter = new ListViewColumnSorter 135 | { 136 | SortOrder = SortOrder.Ascending, 137 | SortColumn = 0 138 | }; 139 | 140 | this.ListViewItemSorter = _listViewColumnSorter; 141 | } 142 | 143 | #endregion 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/FindProjectsDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cyotek.VisualStudioExtensions.AddProjects 2 | { 3 | partial class FindProjectsDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.Label folderLabel; 32 | System.Windows.Forms.Label projectsLabel; 33 | this.folderTextBox = new System.Windows.Forms.TextBox(); 34 | this.browseButton = new System.Windows.Forms.Button(); 35 | this.okButton = new System.Windows.Forms.Button(); 36 | this.cancelButton = new System.Windows.Forms.Button(); 37 | this.projectsListView = new Cyotek.VisualStudioExtensions.AddProjects.FileNameListView(); 38 | this.excludeFoldersLinkLabel = new System.Windows.Forms.LinkLabel(); 39 | folderLabel = new System.Windows.Forms.Label(); 40 | projectsLabel = new System.Windows.Forms.Label(); 41 | this.SuspendLayout(); 42 | // 43 | // folderLabel 44 | // 45 | folderLabel.AutoSize = true; 46 | folderLabel.Location = new System.Drawing.Point(9, 9); 47 | folderLabel.Name = "folderLabel"; 48 | folderLabel.Size = new System.Drawing.Size(39, 13); 49 | folderLabel.TabIndex = 0; 50 | folderLabel.Text = "&Folder:"; 51 | // 52 | // folderTextBox 53 | // 54 | this.folderTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 55 | | System.Windows.Forms.AnchorStyles.Right))); 56 | this.folderTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; 57 | this.folderTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories; 58 | this.folderTextBox.Location = new System.Drawing.Point(12, 25); 59 | this.folderTextBox.Name = "folderTextBox"; 60 | this.folderTextBox.Size = new System.Drawing.Size(456, 20); 61 | this.folderTextBox.TabIndex = 1; 62 | this.folderTextBox.TextChanged += new System.EventHandler(this.folderTextBox_TextChanged); 63 | this.folderTextBox.Leave += new System.EventHandler(this.folderTextBox_Leave); 64 | // 65 | // browseButton 66 | // 67 | this.browseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 68 | this.browseButton.Location = new System.Drawing.Point(474, 23); 69 | this.browseButton.Name = "browseButton"; 70 | this.browseButton.Size = new System.Drawing.Size(75, 23); 71 | this.browseButton.TabIndex = 2; 72 | this.browseButton.Text = "&Browse..."; 73 | this.browseButton.UseVisualStyleBackColor = true; 74 | this.browseButton.Click += new System.EventHandler(this.browseButton_Click); 75 | // 76 | // projectsLabel 77 | // 78 | projectsLabel.AutoSize = true; 79 | projectsLabel.Location = new System.Drawing.Point(9, 57); 80 | projectsLabel.Name = "projectsLabel"; 81 | projectsLabel.Size = new System.Drawing.Size(48, 13); 82 | projectsLabel.TabIndex = 3; 83 | projectsLabel.Text = "&Projects:"; 84 | // 85 | // okButton 86 | // 87 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 88 | this.okButton.Location = new System.Drawing.Point(393, 320); 89 | this.okButton.Name = "okButton"; 90 | this.okButton.Size = new System.Drawing.Size(75, 23); 91 | this.okButton.TabIndex = 6; 92 | this.okButton.Text = "OK"; 93 | this.okButton.UseVisualStyleBackColor = true; 94 | this.okButton.Click += new System.EventHandler(this.okButton_Click); 95 | // 96 | // cancelButton 97 | // 98 | this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 99 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 100 | this.cancelButton.Location = new System.Drawing.Point(474, 320); 101 | this.cancelButton.Name = "cancelButton"; 102 | this.cancelButton.Size = new System.Drawing.Size(75, 23); 103 | this.cancelButton.TabIndex = 7; 104 | this.cancelButton.Text = "Cancel"; 105 | this.cancelButton.UseVisualStyleBackColor = true; 106 | this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 107 | // 108 | // projectsListView 109 | // 110 | this.projectsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 111 | | System.Windows.Forms.AnchorStyles.Left) 112 | | System.Windows.Forms.AnchorStyles.Right))); 113 | this.projectsListView.CheckBoxes = true; 114 | this.projectsListView.FullRowSelect = true; 115 | this.projectsListView.Location = new System.Drawing.Point(12, 73); 116 | this.projectsListView.Name = "projectsListView"; 117 | this.projectsListView.ShowItemToolTips = true; 118 | this.projectsListView.Size = new System.Drawing.Size(537, 241); 119 | this.projectsListView.TabIndex = 4; 120 | this.projectsListView.UseCompatibleStateImageBehavior = false; 121 | this.projectsListView.View = System.Windows.Forms.View.Details; 122 | // 123 | // excludeFoldersLinkLabel 124 | // 125 | this.excludeFoldersLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 126 | this.excludeFoldersLinkLabel.AutoSize = true; 127 | this.excludeFoldersLinkLabel.Location = new System.Drawing.Point(9, 325); 128 | this.excludeFoldersLinkLabel.Name = "excludeFoldersLinkLabel"; 129 | this.excludeFoldersLinkLabel.Size = new System.Drawing.Size(270, 13); 130 | this.excludeFoldersLinkLabel.TabIndex = 5; 131 | this.excludeFoldersLinkLabel.TabStop = true; 132 | this.excludeFoldersLinkLabel.Text = "Update project types and automatically excluded folders"; 133 | this.excludeFoldersLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.excludeFoldersLinkLabel_LinkClicked); 134 | // 135 | // FindProjectsDialog 136 | // 137 | this.AcceptButton = this.okButton; 138 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 139 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 140 | this.CancelButton = this.cancelButton; 141 | this.ClientSize = new System.Drawing.Size(561, 355); 142 | this.Controls.Add(this.excludeFoldersLinkLabel); 143 | this.Controls.Add(this.projectsListView); 144 | this.Controls.Add(this.cancelButton); 145 | this.Controls.Add(this.okButton); 146 | this.Controls.Add(projectsLabel); 147 | this.Controls.Add(this.browseButton); 148 | this.Controls.Add(this.folderTextBox); 149 | this.Controls.Add(folderLabel); 150 | this.Name = "FindProjectsDialog"; 151 | this.Text = "Find Projects"; 152 | this.ResumeLayout(false); 153 | this.PerformLayout(); 154 | 155 | } 156 | 157 | #endregion 158 | private System.Windows.Forms.TextBox folderTextBox; 159 | private System.Windows.Forms.Button browseButton; 160 | private System.Windows.Forms.Button okButton; 161 | private System.Windows.Forms.Button cancelButton; 162 | private FileNameListView projectsListView; 163 | private System.Windows.Forms.LinkLabel excludeFoldersLinkLabel; 164 | } 165 | } -------------------------------------------------------------------------------- /src/FindProjectsDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace Cyotek.VisualStudioExtensions.AddProjects 8 | { 9 | public partial class FindProjectsDialog : BaseForm 10 | { 11 | #region Constants 12 | 13 | private readonly ExtensionSettings _settings; 14 | 15 | #endregion 16 | 17 | #region Fields 18 | 19 | private string[] _searchMasks; 20 | 21 | private bool _searchPathChanged; 22 | 23 | #endregion 24 | 25 | #region Constructors 26 | 27 | public FindProjectsDialog() 28 | { 29 | this.InitializeComponent(); 30 | } 31 | 32 | public FindProjectsDialog(ExtensionSettings settings) 33 | : this() 34 | { 35 | _settings = settings; 36 | } 37 | 38 | #endregion 39 | 40 | #region Properties 41 | 42 | public string[] FileNames 43 | { 44 | get 45 | { 46 | List results; 47 | 48 | results = new List(); 49 | 50 | // ReSharper disable once LoopCanBeConvertedToQuery 51 | foreach (ListViewItem item in projectsListView.CheckedItems) 52 | { 53 | results.Add(item.Name); 54 | } 55 | 56 | return results.ToArray(); 57 | } 58 | } 59 | 60 | #endregion 61 | 62 | #region Methods 63 | 64 | private void browseButton_Click(object sender, EventArgs e) 65 | { 66 | using (FolderBrowserDialog dialog = new FolderBrowserDialog 67 | { 68 | ShowNewFolderButton = true, Description = "Select the &folder to scan for projects:", SelectedPath = folderTextBox.Text 69 | }) 70 | { 71 | if (dialog.ShowDialog(this) == DialogResult.OK) 72 | { 73 | folderTextBox.Text = dialog.SelectedPath; 74 | this.SearchProjects(); 75 | } 76 | } 77 | } 78 | 79 | private void cancelButton_Click(object sender, EventArgs e) 80 | { 81 | this.DialogResult = DialogResult.Cancel; 82 | this.Close(); 83 | } 84 | 85 | private void excludeFoldersLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 86 | { 87 | if (Utilities.ShowSettingsDialog(this, _settings)) 88 | { 89 | // re-apply the search so we can exclude anything previously picked up 90 | _searchMasks = null; // Need to reset this otherwise changes to project types won't be picked up 91 | this.SearchProjects(); 92 | } 93 | } 94 | 95 | private void folderTextBox_Leave(object sender, EventArgs e) 96 | { 97 | if (_searchPathChanged) 98 | { 99 | this.SearchProjects(); 100 | } 101 | } 102 | 103 | private void folderTextBox_TextChanged(object sender, EventArgs e) 104 | { 105 | _searchPathChanged = true; 106 | } 107 | 108 | private bool IsExcluded(string fileName) 109 | { 110 | bool excluded; 111 | 112 | excluded = false; 113 | 114 | // ReSharper disable once LoopCanBeConvertedToQuery 115 | foreach (string pattern in _settings.ExcludedFolders) 116 | { 117 | // TODO: Can't be hassled with regex's right now, so it's just a contains match 118 | if (fileName.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) != -1) 119 | { 120 | excluded = true; 121 | break; 122 | } 123 | } 124 | 125 | return excluded; 126 | } 127 | 128 | private void okButton_Click(object sender, EventArgs e) 129 | { 130 | if (projectsListView.CheckedItems.Count != 0) 131 | { 132 | this.DialogResult = DialogResult.OK; 133 | this.Close(); 134 | } 135 | else 136 | { 137 | this.DialogResult = DialogResult.None; 138 | MessageBox.Show("Please select the projects to add.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); 139 | } 140 | } 141 | 142 | private void SearchProjects() 143 | { 144 | try 145 | { 146 | string path; 147 | 148 | _searchPathChanged = false; 149 | 150 | path = folderTextBox.Text; 151 | 152 | if (!string.IsNullOrWhiteSpace(path) && path.Length > 3 && Directory.Exists(path)) 153 | { 154 | HashSet matchingfiles; 155 | 156 | matchingfiles = new HashSet(StringComparer.OrdinalIgnoreCase); 157 | 158 | if (_searchMasks == null) 159 | { 160 | _searchMasks = Utilities.GetSearchMasks(_settings.ProjectTypes); 161 | } 162 | 163 | if (path[path.Length - 1] != Path.DirectorySeparatorChar && path[path.Length - 1] != Path.AltDirectorySeparatorChar) 164 | { 165 | path = string.Concat(path, Path.DirectorySeparatorChar.ToString()); 166 | } 167 | 168 | this.BeginAction(); 169 | 170 | Parallel.ForEach(_searchMasks, mask => 171 | { 172 | // ReSharper disable once LoopCanBePartlyConvertedToQuery 173 | foreach (string fileName in Directory.EnumerateFiles(path, mask, SearchOption.AllDirectories)) 174 | { 175 | if (!matchingfiles.Contains(fileName) && !_settings.Projects.Contains(fileName) && !this.IsExcluded(fileName)) 176 | { 177 | matchingfiles.Add(fileName); 178 | } 179 | } 180 | }); 181 | 182 | projectsListView.BeginUpdate(); 183 | projectsListView.Items.Clear(); 184 | 185 | foreach (string fileName in matchingfiles) 186 | { 187 | projectsListView.AddFile(fileName, true); 188 | } 189 | 190 | projectsListView.EndUpdate(); 191 | 192 | this.EndAction(); 193 | } 194 | } 195 | catch (Exception ex) 196 | { 197 | Utilities.ShowExceptionMessage(ex); 198 | } 199 | } 200 | 201 | #endregion 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /src/FindProjectsDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | False 122 | 123 | 124 | False 125 | 126 | -------------------------------------------------------------------------------- /src/FolderExclusionsDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Cyotek.VisualStudioExtensions.AddProjects 2 | { 3 | partial class FolderExclusionsDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.Label folderExclusionsLabel; 32 | System.Windows.Forms.Label projectTypesLabel; 33 | this.folderExclusionsTextBox = new System.Windows.Forms.TextBox(); 34 | this.okButton = new System.Windows.Forms.Button(); 35 | this.cancelButton = new System.Windows.Forms.Button(); 36 | this.resetToDefaultLinkLabel = new System.Windows.Forms.LinkLabel(); 37 | this.projectTypesTextBox = new System.Windows.Forms.TextBox(); 38 | folderExclusionsLabel = new System.Windows.Forms.Label(); 39 | projectTypesLabel = new System.Windows.Forms.Label(); 40 | this.SuspendLayout(); 41 | // 42 | // folderExclusionsLabel 43 | // 44 | folderExclusionsLabel.AutoSize = true; 45 | folderExclusionsLabel.Location = new System.Drawing.Point(9, 9); 46 | folderExclusionsLabel.Name = "folderExclusionsLabel"; 47 | folderExclusionsLabel.Size = new System.Drawing.Size(252, 13); 48 | folderExclusionsLabel.TabIndex = 0; 49 | folderExclusionsLabel.Text = "Enter &folder exclusions below, one exclusion per line"; 50 | // 51 | // projectTypesLabel 52 | // 53 | projectTypesLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 54 | projectTypesLabel.AutoSize = true; 55 | projectTypesLabel.Location = new System.Drawing.Point(321, 9); 56 | projectTypesLabel.Name = "projectTypesLabel"; 57 | projectTypesLabel.Size = new System.Drawing.Size(129, 13); 58 | projectTypesLabel.TabIndex = 2; 59 | projectTypesLabel.Text = "Enter &project types below:"; 60 | // 61 | // folderExclusionsTextBox 62 | // 63 | this.folderExclusionsTextBox.AcceptsReturn = true; 64 | this.folderExclusionsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 65 | | System.Windows.Forms.AnchorStyles.Left) 66 | | System.Windows.Forms.AnchorStyles.Right))); 67 | this.folderExclusionsTextBox.Location = new System.Drawing.Point(12, 25); 68 | this.folderExclusionsTextBox.Multiline = true; 69 | this.folderExclusionsTextBox.Name = "folderExclusionsTextBox"; 70 | this.folderExclusionsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; 71 | this.folderExclusionsTextBox.Size = new System.Drawing.Size(284, 280); 72 | this.folderExclusionsTextBox.TabIndex = 1; 73 | // 74 | // okButton 75 | // 76 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 77 | this.okButton.Location = new System.Drawing.Point(469, 311); 78 | this.okButton.Name = "okButton"; 79 | this.okButton.Size = new System.Drawing.Size(75, 23); 80 | this.okButton.TabIndex = 5; 81 | this.okButton.Text = "OK"; 82 | this.okButton.UseVisualStyleBackColor = true; 83 | this.okButton.Click += new System.EventHandler(this.okButton_Click); 84 | // 85 | // cancelButton 86 | // 87 | this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 88 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 89 | this.cancelButton.Location = new System.Drawing.Point(550, 311); 90 | this.cancelButton.Name = "cancelButton"; 91 | this.cancelButton.Size = new System.Drawing.Size(75, 23); 92 | this.cancelButton.TabIndex = 6; 93 | this.cancelButton.Text = "Cancel"; 94 | this.cancelButton.UseVisualStyleBackColor = true; 95 | this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 96 | // 97 | // resetToDefaultLinkLabel 98 | // 99 | this.resetToDefaultLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 100 | this.resetToDefaultLinkLabel.AutoSize = true; 101 | this.resetToDefaultLinkLabel.Location = new System.Drawing.Point(9, 316); 102 | this.resetToDefaultLinkLabel.Name = "resetToDefaultLinkLabel"; 103 | this.resetToDefaultLinkLabel.Size = new System.Drawing.Size(82, 13); 104 | this.resetToDefaultLinkLabel.TabIndex = 4; 105 | this.resetToDefaultLinkLabel.TabStop = true; 106 | this.resetToDefaultLinkLabel.Text = "Reset to default"; 107 | this.resetToDefaultLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.resetToDefaultLinkLabel_LinkClicked); 108 | // 109 | // projectTypesTextBox 110 | // 111 | this.projectTypesTextBox.AcceptsReturn = true; 112 | this.projectTypesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 113 | | System.Windows.Forms.AnchorStyles.Right))); 114 | this.projectTypesTextBox.Location = new System.Drawing.Point(324, 25); 115 | this.projectTypesTextBox.Multiline = true; 116 | this.projectTypesTextBox.Name = "projectTypesTextBox"; 117 | this.projectTypesTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; 118 | this.projectTypesTextBox.Size = new System.Drawing.Size(301, 280); 119 | this.projectTypesTextBox.TabIndex = 3; 120 | // 121 | // FolderExclusionsDialog 122 | // 123 | this.AcceptButton = this.okButton; 124 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 125 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 126 | this.CancelButton = this.cancelButton; 127 | this.ClientSize = new System.Drawing.Size(637, 346); 128 | this.Controls.Add(this.projectTypesTextBox); 129 | this.Controls.Add(projectTypesLabel); 130 | this.Controls.Add(this.resetToDefaultLinkLabel); 131 | this.Controls.Add(this.cancelButton); 132 | this.Controls.Add(this.okButton); 133 | this.Controls.Add(this.folderExclusionsTextBox); 134 | this.Controls.Add(folderExclusionsLabel); 135 | this.Name = "FolderExclusionsDialog"; 136 | this.Text = "Folder Exclusions"; 137 | this.ResumeLayout(false); 138 | this.PerformLayout(); 139 | 140 | } 141 | 142 | #endregion 143 | private System.Windows.Forms.TextBox folderExclusionsTextBox; 144 | private System.Windows.Forms.Button okButton; 145 | private System.Windows.Forms.Button cancelButton; 146 | private System.Windows.Forms.LinkLabel resetToDefaultLinkLabel; 147 | private System.Windows.Forms.TextBox projectTypesTextBox; 148 | } 149 | } -------------------------------------------------------------------------------- /src/FolderExclusionsDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Text; 5 | using System.Windows.Forms; 6 | 7 | // TODO: Rename this to be a settings dialog 8 | 9 | namespace Cyotek.VisualStudioExtensions.AddProjects 10 | { 11 | using System.Linq; 12 | 13 | public partial class FolderExclusionsDialog : BaseForm 14 | { 15 | #region Constructors 16 | 17 | public FolderExclusionsDialog() 18 | { 19 | this.InitializeComponent(); 20 | } 21 | 22 | public FolderExclusionsDialog(ExtensionSettingsProjectCollection exclusions, ExtensionSettingsProjectCollection projectTypes) 23 | : this() 24 | { 25 | if (exclusions.Count != 0) 26 | { 27 | StringBuilder sb; 28 | 29 | sb = new StringBuilder(); 30 | 31 | foreach (string exclusion in exclusions) 32 | { 33 | sb.AppendLine(exclusion); 34 | } 35 | 36 | folderExclusionsTextBox.Text = sb.ToString(); 37 | } 38 | if (projectTypes.Count != 0) 39 | { 40 | var sb = new StringBuilder(); 41 | foreach (var projectType in projectTypes) 42 | { 43 | sb.AppendLine(projectType); 44 | } 45 | projectTypesTextBox.Text = sb.ToString(); 46 | } 47 | } 48 | 49 | #endregion 50 | 51 | #region Properties 52 | 53 | [Browsable(false)] 54 | public string[] ExcludedFolders 55 | { 56 | get 57 | { 58 | List results; 59 | 60 | results = new List(); 61 | 62 | // ReSharper disable once LoopCanBePartlyConvertedToQuery 63 | foreach (string line in folderExclusionsTextBox.Lines) 64 | { 65 | if (!string.IsNullOrWhiteSpace(line) && !results.Contains(line)) 66 | { 67 | results.Add(line); 68 | } 69 | } 70 | 71 | return results.ToArray(); 72 | } 73 | } 74 | 75 | [Browsable(false)] 76 | public string[] ProjectTypes 77 | => projectTypesTextBox.Lines.Where(x => !string.IsNullOrWhiteSpace(x)).Distinct().ToArray(); 78 | 79 | #endregion 80 | 81 | #region Methods 82 | 83 | private void cancelButton_Click(object sender, EventArgs e) 84 | { 85 | this.DialogResult = DialogResult.Cancel; 86 | this.Close(); 87 | } 88 | 89 | private void okButton_Click(object sender, EventArgs e) 90 | { 91 | this.DialogResult = DialogResult.OK; 92 | this.Close(); 93 | } 94 | 95 | private void resetToDefaultLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 96 | { 97 | if (MessageBox.Show(this, "Are you sure you want to reset exclusion and project type settings to their default values?", "Reset Settings", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 98 | { 99 | folderExclusionsTextBox.Text = "\\bower_components\\\r\n\\node_modules\\\r\n\\bin\\\r\n\\obj\\"; 100 | projectTypesTextBox.Text = "C# Projects|*.csproj\r\nVisual Basic Projects|*.vbproj\r\nC++ Projects|*.vcproj;*.vcxproj\r\nF# Projects|*.fsproj\r\nNuGet Packager Projects|*.nuproj"; 101 | } 102 | } 103 | 104 | #endregion 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/FolderExclusionsDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | False 122 | 123 | 124 | False 125 | 126 | -------------------------------------------------------------------------------- /src/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. Project-level 3 | // suppressions either have no target or are given a specific target 4 | // and scoped to a namespace, type, member, etc. 5 | // 6 | // To add a suppression to this file, right-click the message in the 7 | // Error List, point to "Suppress Message(s)", and click "In Project 8 | // Suppression File". You do not need to add suppressions to this 9 | // file manually. 10 | 11 | using System.Diagnostics.CodeAnalysis; 12 | 13 | [assembly: SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")] 14 | -------------------------------------------------------------------------------- /src/Guids.cs: -------------------------------------------------------------------------------- 1 | // Guids.cs 2 | // MUST match guids.h 3 | 4 | using System; 5 | 6 | namespace Cyotek.VisualStudioExtensions.AddProjects 7 | { 8 | internal static class GuidList 9 | { 10 | #region Constants 11 | 12 | public const string guidCyotek_AddProjectsCmdSetString = "e9ea7dba-9b3b-431c-9fe8-6f61e4196e35"; 13 | 14 | public const string guidCyotek_AddProjectsPkgString = "af385d18-dd14-4c1b-a4ad-3e69c525312f"; 15 | 16 | #endregion 17 | 18 | public static readonly Guid guidCyotek_AddProjectsCmdSet = new Guid(guidCyotek_AddProjectsCmdSetString); 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /src/ListViewColumnSorter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Windows.Forms; 4 | 5 | namespace Cyotek.VisualStudioExtensions.AddProjects 6 | { 7 | internal sealed class ListViewColumnSorter : IComparer 8 | { 9 | #region Constants 10 | 11 | private readonly IComparer _comparer; 12 | 13 | #endregion 14 | 15 | #region Constructors 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public ListViewColumnSorter() 21 | : this(StringComparer.InvariantCultureIgnoreCase /* StringLogicalComparer.Default */) 22 | { } 23 | 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | /// The comparer. 28 | /// comparer 29 | public ListViewColumnSorter(IComparer comparer) 30 | { 31 | if (comparer == null) 32 | { 33 | throw new ArgumentNullException(nameof(comparer)); 34 | } 35 | 36 | _comparer = comparer; 37 | } 38 | 39 | #endregion 40 | 41 | #region Properties 42 | 43 | /// 44 | /// Gets or sets the number of the column to which to apply the sorting operation (Defaults to '0'). 45 | /// 46 | public int SortColumn { get; set; } 47 | 48 | /// 49 | /// Gets or sets the order of sorting to apply (for example, 'Ascending' or 'Descending'). 50 | /// 51 | public SortOrder SortOrder { get; set; } 52 | 53 | #endregion 54 | 55 | #region IComparer Interface 56 | 57 | /// 58 | /// This method is inherited from the IComparer interface. It compares the two objects passed using a case insensitive comparison. 59 | /// 60 | /// First object to be compared 61 | /// Second object to be compared 62 | /// The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y' 63 | int IComparer.Compare(object x, object y) 64 | { 65 | int compareResult; 66 | ListViewItem listviewX; 67 | ListViewItem listviewY; 68 | ListViewItem.ListViewSubItem subItemX; 69 | ListViewItem.ListViewSubItem subItemY; 70 | string textX; 71 | string textY; 72 | 73 | // Cast the objects to be compared to ListViewItem objects 74 | listviewX = (ListViewItem)x; 75 | listviewY = (ListViewItem)y; 76 | /* 77 | subItemX = this.SortColumn.Between(0, listviewX.SubItems.Count - 1) ? listviewX.SubItems[this.SortColumn] : null; 78 | subItemY = this.SortColumn.Between(0, listviewY.SubItems.Count - 1) ? listviewY.SubItems[this.SortColumn] : null; 79 | */ 80 | subItemX = this.SortColumn >= 0 && this.SortColumn < listviewX.SubItems.Count ? listviewX.SubItems[this.SortColumn] : null; 81 | subItemY = this.SortColumn >= 0 && this.SortColumn < listviewY.SubItems.Count ? listviewY.SubItems[this.SortColumn] : null; 82 | textX = subItemX != null ? subItemX.Text : string.Empty; 83 | textY = subItemY != null ? subItemY.Text : string.Empty; 84 | 85 | // Compare the two items 86 | compareResult = _comparer.Compare(textX, textY); 87 | 88 | // Calculate correct return value based on object comparison 89 | if (this.SortOrder == SortOrder.Descending) 90 | { 91 | // Descending sort is selected, return negative result of compare operation 92 | compareResult = -compareResult; 93 | } 94 | 95 | return compareResult; 96 | } 97 | 98 | #endregion 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Cyotek.VisualStudioExtensions.AddProjects 5 | { 6 | internal static class NativeMethods 7 | { 8 | #region Externals 9 | 10 | [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)] 11 | internal static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList); 12 | 13 | #endregion 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/PkgCmdID.cs: -------------------------------------------------------------------------------- 1 | // PkgCmdID.cs 2 | // MUST match PkgCmdID.h 3 | 4 | namespace Cyotek.VisualStudioExtensions.AddProjects 5 | { 6 | internal static class PkgCmdIDList 7 | { 8 | #region Constants 9 | 10 | public const uint cmdidCyotekAddProjects = 0x100; 11 | 12 | #endregion 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Resources; 4 | using System.Runtime.InteropServices; 5 | 6 | [assembly: AssemblyTitle("Cyotek Add Projects Visual Studio Extension")] 7 | [assembly: AssemblyDescription("")] 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyCompany("Cyotek Ltd")] 10 | [assembly: AssemblyProduct("Cyotek Add Projects Visual Studio Extension")] 11 | [assembly: AssemblyCopyright("Copyright © 2013-2022 Cyotek Ltd. All Rights Reserved.")] 12 | [assembly: AssemblyTrademark("")] 13 | [assembly: AssemblyCulture("")] 14 | [assembly: ComVisible(false)] 15 | [assembly: CLSCompliant(false)] 16 | [assembly: NeutralResourcesLanguage("en-US")] 17 | [assembly: AssemblyVersion("1.0.8.2")] 18 | [assembly: AssemblyFileVersion("1.0.8.2")] 19 | -------------------------------------------------------------------------------- /src/Resources/Images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/src/Resources/Images.png -------------------------------------------------------------------------------- /src/Resources/Package.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/src/Resources/Package.ico -------------------------------------------------------------------------------- /src/Resources/preview-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/src/Resources/preview-image.png -------------------------------------------------------------------------------- /src/Utilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace Cyotek.VisualStudioExtensions.AddProjects 7 | { 8 | internal static class Utilities 9 | { 10 | #region Static Methods 11 | 12 | public static bool ShowSettingsDialog(IWin32Window owner, ExtensionSettings settings) 13 | { 14 | bool result; 15 | 16 | using (FolderExclusionsDialog dialog = new FolderExclusionsDialog(settings.ExcludedFolders, settings.ProjectTypes)) 17 | { 18 | result = dialog.ShowDialog(owner) == DialogResult.OK; 19 | 20 | if (result) 21 | { 22 | // update the settings 23 | // TODO: note they currently won't be saved as we don't have access to the filename right now 24 | settings.ExcludedFolders.Clear(); 25 | settings.ExcludedFolders.AddRange(dialog.ExcludedFolders); 26 | 27 | settings.ProjectTypes.Clear(); 28 | settings.ProjectTypes.AddRange(dialog.ProjectTypes); 29 | } 30 | } 31 | 32 | return result; 33 | } 34 | 35 | internal static FileDialogFilterBuilder GetProjectsFilter(ExtensionSettingsProjectCollection projectTypes) 36 | { 37 | FileDialogFilterBuilder builder; 38 | 39 | builder = new FileDialogFilterBuilder(); 40 | 41 | foreach (string projectType in projectTypes) 42 | { 43 | int endOfNamePosition; 44 | string projectName; 45 | string projectFilter; 46 | 47 | endOfNamePosition = projectType.IndexOf('|'); 48 | if (endOfNamePosition == -1) 49 | { 50 | projectName = projectType; 51 | projectFilter = projectType; 52 | } 53 | else 54 | { 55 | projectName = projectType.Substring(0, endOfNamePosition); 56 | projectFilter = projectType.Substring(endOfNamePosition + 1); 57 | } 58 | 59 | builder.Add(projectName, projectFilter); 60 | } 61 | 62 | builder.AddAllFiles(); 63 | 64 | return builder; 65 | } 66 | 67 | internal static string[] GetSearchMasks(ExtensionSettingsProjectCollection projectTypes) 68 | { 69 | return GetSearchMasks(GetProjectsFilter(projectTypes).ToString()); 70 | } 71 | 72 | internal static string[] GetSearchMasks(string filter) 73 | { 74 | List masks; 75 | string[] filterParts; 76 | 77 | filterParts = filter.Split('|'); 78 | masks = new List(); 79 | 80 | for (int i = 1; i < filterParts.Length; i += 2) 81 | { 82 | masks.AddRange(filterParts[i].Split(';').Where(mask => mask != "*.*" && !masks.Contains(mask, StringComparer.InvariantCultureIgnoreCase))); 83 | } 84 | 85 | return masks.ToArray(); 86 | } 87 | 88 | internal static void ShowExceptionMessage(Exception ex) 89 | { 90 | MessageBox.Show(ex.GetBaseException().Message, "Add Projects Extension", MessageBoxButtons.OK, MessageBoxIcon.Error); 91 | } 92 | 93 | #endregion 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/VSPackage.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Cyotek.VisualStudioExtensions.AddProjects { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class VSPackage { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal VSPackage() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Cyotek.VisualStudioExtensions.AddProjects.VSPackage", typeof(VSPackage).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Add Projects. 65 | /// 66 | internal static string _110 { 67 | get { 68 | return ResourceManager.GetString("110", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Cyotek Add Projects 1.0.8.2 package for Microsoft Visual Studio. For more information about this extension, visit http://www.cyotek.com/. Copyright © 2013-2022 Cyotek Ltd.. 74 | /// 75 | internal static string _112 { 76 | get { 77 | return ResourceManager.GetString("112", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 83 | /// 84 | internal static System.Drawing.Icon _400 { 85 | get { 86 | object obj = ResourceManager.GetObject("400", resourceCulture); 87 | return ((System.Drawing.Icon)(obj)); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/VSPackage.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Add Projects 122 | 123 | 124 | Cyotek Add Projects 1.0.8.2 package for Microsoft Visual Studio. For more information about this extension, visit http://www.cyotek.com/. Copyright © 2013-2022 Cyotek Ltd. 125 | 126 | 127 | 128 | Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | -------------------------------------------------------------------------------- /src/cyopublic.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyotek/Cyotek.AddProjects/b4bd82f009acf4ee99aa720c9da7b70a2129b3bb/src/cyopublic.snk -------------------------------------------------------------------------------- /src/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Add Existing Projects 6 | A simple extension that allows you to easily add multiple projects to a solution with having to manually browse multiple files. 7 | http://www.cyotek.com/blog/tag/vsix 8 | res\LICENSE.txt 9 | res\Package.ico 10 | res\preview-image.png 11 | 12 | true 13 | 14 | 15 | 16 | amd64 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | --------------------------------------------------------------------------------