├── .editorconfig ├── .gitattributes ├── .github ├── CONTRIBUTING.md └── ISSUE_TEMPLATE.md ├── .gitignore ├── LICENSE ├── README.md ├── SolutionExtensions.sln ├── SolutionExtensions.vsext ├── appveyor.yml ├── art ├── dialog-install-missing.png ├── dialog-missing-extensions.png ├── dialog-suggested-extensions.png ├── infobar.png ├── intellisense.png ├── logo.png ├── modify-solution-extensions.png ├── prompt-restart.png ├── toolbar-suggested-extensions.png └── vsext-on-disk.png ├── lib ├── Microsoft.JSON.Core.dll ├── Microsoft.JSON.Editor.dll ├── Microsoft.VisualStudio.ExtensionManager.dll └── Microsoft.Web.Editor.dll └── src ├── Commands ├── ModifyMissingCommand.cs ├── ShowMissingCommand.cs ├── ShowSuggestionsCommand.cs └── SolutionHandler.cs ├── Constants.cs ├── ExtensionManager ├── ExtensionInstalledChecker.cs ├── ExtensionInstaller.cs ├── GalleryEntry.cs ├── InstallProgressEventAgs.cs ├── InstallerDialog.xaml ├── InstallerDialog.xaml.cs ├── InstallerProgress.xaml └── InstallerProgress.xaml.cs ├── Helpers └── Logger.cs ├── JSON ├── Completion │ ├── ExtensionCompletionProvider.cs │ └── SimpleCompletionEntry.cs ├── ContentType │ └── VsExtContentTypeDefinition.cs └── Schema │ ├── SchemaSelector.cs │ ├── extensions-schema.json │ ├── solution.vsext │ ├── suggestions-schema.json │ └── suggestions.json ├── Model ├── ExtensionFileEventArgs.cs ├── ExtensionFileModel.cs ├── ExtensionModel.cs ├── IExtensionModel.cs ├── InstallerDialogViewModel.cs ├── SuggestionFileModel.cs ├── SuggestionModel.cs └── SuggestionResult.cs ├── Properties └── AssemblyInfo.cs ├── Resources ├── feedback.png ├── icon.png └── preview.png ├── Settings.cs ├── SolutionExtensions.csproj ├── Suggestions ├── DocumentOpenListener.cs ├── InfoBarService.cs └── SuggestionHandler.cs ├── VSCommandTable.cs ├── VSCommandTable.vsct ├── VSPackage.cs ├── icons.pkgdef ├── packages.config ├── source.extension.cs ├── source.extension.ico ├── source.extension.resx └── source.extension.vsixmanifest /.editorconfig: -------------------------------------------------------------------------------- 1 | # Top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | end_of_line = crlf 7 | indent_size = 4 8 | 9 | [*.json] 10 | indent_style = space 11 | indent_size = 2 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Looking to contribute something? **Here's how you can help.** 4 | 5 | Please take a moment to review this document in order to make the contribution 6 | process easy and effective for everyone involved. 7 | 8 | Following these guidelines helps to communicate that you respect the time of 9 | the developers managing and developing this open source project. In return, 10 | they should reciprocate that respect in addressing your issue or assessing 11 | patches and features. 12 | 13 | 14 | ## Using the issue tracker 15 | 16 | The issue tracker is the preferred channel for [bug reports](#bug-reports), 17 | [features requests](#feature-requests) and 18 | [submitting pull requests](#pull-requests), but please respect the 19 | following restrictions: 20 | 21 | * Please **do not** use the issue tracker for personal support requests. Stack 22 | Overflow is a better place to get help. 23 | 24 | * Please **do not** derail or troll issues. Keep the discussion on topic and 25 | respect the opinions of others. 26 | 27 | * Please **do not** open issues or pull requests which *belongs to* third party 28 | components. 29 | 30 | 31 | ## Bug reports 32 | 33 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 34 | Good bug reports are extremely helpful, so thanks! 35 | 36 | Guidelines for bug reports: 37 | 38 | 1. **Use the GitHub issue search** — check if the issue has already been 39 | reported. 40 | 41 | 2. **Check if the issue has been fixed** — try to reproduce it using the 42 | latest `master` or development branch in the repository. 43 | 44 | 3. **Isolate the problem** — ideally create an 45 | [SSCCE](http://www.sscce.org/) and a live example. 46 | Uploading the project on cloud storage (OneDrive, DropBox, et el.) 47 | or creating a sample GitHub repository is also helpful. 48 | 49 | 50 | A good bug report shouldn't leave others needing to chase you up for more 51 | information. Please try to be as detailed as possible in your report. What is 52 | your environment? What steps will reproduce the issue? What browser(s) and OS 53 | experience the problem? Do other browsers show the bug differently? What 54 | would you expect to be the outcome? All these details will help people to fix 55 | any potential bugs. 56 | 57 | Example: 58 | 59 | > Short and descriptive example bug report title 60 | > 61 | > A summary of the issue and the Visual Studio, browser, OS environments 62 | > in which it occurs. If suitable, include the steps required to reproduce the bug. 63 | > 64 | > 1. This is the first step 65 | > 2. This is the second step 66 | > 3. Further steps, etc. 67 | > 68 | > `` - a link to the project/file uploaded on cloud storage or other publicly accessible medium. 69 | > 70 | > Any other information you want to share that is relevant to the issue being 71 | > reported. This might include the lines of code that you have identified as 72 | > causing the bug, and potential solutions (and your opinions on their 73 | > merits). 74 | 75 | 76 | ## Feature requests 77 | 78 | Feature requests are welcome. But take a moment to find out whether your idea 79 | fits with the scope and aims of the project. It's up to *you* to make a strong 80 | case to convince the project's developers of the merits of this feature. Please 81 | provide as much detail and context as possible. 82 | 83 | 84 | ## Pull requests 85 | 86 | Good pull requests, patches, improvements and new features are a fantastic 87 | help. They should remain focused in scope and avoid containing unrelated 88 | commits. 89 | 90 | **Please ask first** before embarking on any significant pull request (e.g. 91 | implementing features, refactoring code, porting to a different language), 92 | otherwise you risk spending a lot of time working on something that the 93 | project's developers might not want to merge into the project. 94 | 95 | Please adhere to the [coding guidelines](#code-guidelines) used throughout the 96 | project (indentation, accurate comments, etc.) and any other requirements 97 | (such as test coverage). 98 | 99 | Adhering to the following process is the best way to get your work 100 | included in the project: 101 | 102 | 1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, 103 | and configure the remotes: 104 | 105 | ```bash 106 | # Clone your fork of the repo into the current directory 107 | git clone https://github.com//.git 108 | # Navigate to the newly cloned directory 109 | cd 110 | # Assign the original repo to a remote called "upstream" 111 | git remote add upstream https://github.com/madskristensen/.git 112 | ``` 113 | 114 | 2. If you cloned a while ago, get the latest changes from upstream: 115 | 116 | ```bash 117 | git checkout master 118 | git pull upstream master 119 | ``` 120 | 121 | 3. Create a new topic branch (off the main project development branch) to 122 | contain your feature, change, or fix: 123 | 124 | ```bash 125 | git checkout -b 126 | ``` 127 | 128 | 4. Commit your changes in logical chunks. Please adhere to these [git commit 129 | message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 130 | or your code is unlikely be merged into the main project. Use Git's 131 | [interactive rebase](https://help.github.com/articles/interactive-rebase) 132 | feature to tidy up your commits before making them public. Also, prepend name of the feature 133 | to the commit message. For instance: "SCSS: Fixes compiler results for IFileListener.\nFixes `#123`" 134 | 135 | 5. Locally merge (or rebase) the upstream development branch into your topic branch: 136 | 137 | ```bash 138 | git pull [--rebase] upstream master 139 | ``` 140 | 141 | 6. Push your topic branch up to your fork: 142 | 143 | ```bash 144 | git push origin 145 | ``` 146 | 147 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 148 | with a clear title and description against the `master` branch. 149 | 150 | 151 | ## Code guidelines 152 | 153 | - Always use proper indentation. 154 | - In Visual Studio under `Tools > Options > Text Editor > C# > Advanced`, make sure 155 | `Place 'System' directives first when sorting usings` option is enabled (checked). 156 | - Before committing, organize usings for each updated C# source file. Either you can 157 | right-click editor and select `Organize Usings > Remove and sort` OR use extension 158 | like [BatchFormat](http://visualstudiogallery.msdn.microsoft.com/a7f75c34-82b4-4357-9c66-c18e32b9393e). 159 | - Before committing, run Code Analysis in `Debug` configuration and follow the guidelines 160 | to fix CA issues. Code Analysis commits can be made separately. 161 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Installed product versions 2 | - Visual Studio: [example 2015 Professional] 3 | - This extension: [example 1.1.21] 4 | 5 | ### Description 6 | Replace this text with a short description 7 | 8 | ### Steps to recreate 9 | 1. Replace this 10 | 2. text with 11 | 3. the steps 12 | 4. to recreate 13 | 14 | ### Current behavior 15 | Explain what it's doing and why it's wrong 16 | 17 | ### Expected behavior 18 | Explain what it should be doing after it's fixed. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | .vs 10 | 11 | # Build results 12 | [Dd]ebug/ 13 | [Dd]ebugPublic/ 14 | [Rr]elease/ 15 | [Rr]eleases/ 16 | x64/ 17 | x86/ 18 | build/ 19 | bld/ 20 | [Bb]in/ 21 | [Oo]bj/ 22 | 23 | # Roslyn cache directories 24 | *.ide/ 25 | 26 | # MSTest test Results 27 | [Tt]est[Rr]esult*/ 28 | [Bb]uild[Ll]og.* 29 | 30 | #NUNIT 31 | *.VisualState.xml 32 | TestResult.xml 33 | 34 | # Build Results of an ATL Project 35 | [Dd]ebugPS/ 36 | [Rr]eleasePS/ 37 | dlldata.c 38 | 39 | *_i.c 40 | *_p.c 41 | *_i.h 42 | *.ilk 43 | *.meta 44 | *.obj 45 | *.pch 46 | *.pdb 47 | *.pgc 48 | *.pgd 49 | *.rsp 50 | *.sbr 51 | *.tlb 52 | *.tli 53 | *.tlh 54 | *.tmp 55 | *.tmp_proj 56 | *.log 57 | *.vspscc 58 | *.vssscc 59 | .builds 60 | *.pidb 61 | *.svclog 62 | *.scc 63 | 64 | # Chutzpah Test files 65 | _Chutzpah* 66 | 67 | # Visual C++ cache files 68 | ipch/ 69 | *.aps 70 | *.ncb 71 | *.opensdf 72 | *.sdf 73 | *.cachefile 74 | 75 | # Visual Studio profiler 76 | *.psess 77 | *.vsp 78 | *.vspx 79 | 80 | # TFS 2012 Local Workspace 81 | $tf/ 82 | 83 | # Guidance Automation Toolkit 84 | *.gpState 85 | 86 | # ReSharper is a .NET coding add-in 87 | _ReSharper*/ 88 | *.[Rr]e[Ss]harper 89 | *.DotSettings.user 90 | 91 | # JustCode is a .NET coding addin-in 92 | .JustCode 93 | 94 | # TeamCity is a build add-in 95 | _TeamCity* 96 | 97 | # DotCover is a Code Coverage Tool 98 | *.dotCover 99 | 100 | # NCrunch 101 | _NCrunch_* 102 | .*crunch*.local.xml 103 | 104 | # MightyMoose 105 | *.mm.* 106 | AutoTest.Net/ 107 | 108 | # Web workbench (sass) 109 | .sass-cache/ 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.[Pp]ublish.xml 129 | *.azurePubxml 130 | # TODO: Comment the next line if you want to checkin your web deploy settings 131 | # but database connection strings (with potential passwords) will be unencrypted 132 | *.pubxml 133 | *.publishproj 134 | 135 | # NuGet Packages 136 | *.nupkg 137 | # The packages folder can be ignored because of Package Restore 138 | **/packages/* 139 | # except build/, which is used as an MSBuild target. 140 | !**/packages/build/ 141 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 142 | #!**/packages/repositories.config 143 | 144 | # Windows Azure Build Output 145 | csx/ 146 | *.build.csdef 147 | 148 | # Windows Store app package directory 149 | AppPackages/ 150 | 151 | # Others 152 | sql/ 153 | *.Cache 154 | ClientBin/ 155 | [Ss]tyle[Cc]op.* 156 | ~$* 157 | *~ 158 | *.dbmdl 159 | *.dbproj.schemaview 160 | *.pfx 161 | *.publishsettings 162 | node_modules/ 163 | 164 | # RIA/Silverlight projects 165 | Generated_Code/ 166 | 167 | # Backup & report files from converting an old project file 168 | # to a newer Visual Studio version. Backup files are not needed, 169 | # because we have git ;-) 170 | _UpgradeReport_Files/ 171 | Backup*/ 172 | UpgradeLog*.XML 173 | UpgradeLog*.htm 174 | 175 | # SQL Server files 176 | *.mdf 177 | *.ldf 178 | 179 | # Business Intelligence projects 180 | *.rdl.data 181 | *.bim.layout 182 | *.bim_*.settings 183 | 184 | # Microsoft Fakes 185 | FakesAssemblies/ 186 | 187 | # ========================= 188 | # Operating System Files 189 | # ========================= 190 | 191 | # OSX 192 | # ========================= 193 | 194 | .DS_Store 195 | .AppleDouble 196 | .LSOverride 197 | 198 | # Thumbnails 199 | ._* 200 | 201 | # Files that might appear on external disk 202 | .Spotlight-V100 203 | .Trashes 204 | 205 | # Directories potentially created on remote AFP share 206 | .AppleDB 207 | .AppleDesktop 208 | Network Trash Folder 209 | Temporary Items 210 | .apdisk 211 | 212 | # Windows 213 | # ========================= 214 | 215 | # Windows image file caches 216 | Thumbs.db 217 | ehthumbs.db 218 | 219 | # Folder config file 220 | Desktop.ini 221 | 222 | # Recycle Bin used on file shares 223 | $RECYCLE.BIN/ 224 | 225 | # Windows Installer files 226 | *.cab 227 | *.msi 228 | *.msm 229 | *.msp 230 | 231 | # Windows shortcuts 232 | *.lnk 233 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Mads Kristensen 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Suggested Extensions for Visual Studio 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/fmu7jnie15aj48j4?svg=true)](https://ci.appveyor.com/project/madskristensen/solutionextensions) 4 | 5 | Download from the 6 | [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/3be88243-8bf1-407a-a7ca-a968d0de2d59) 7 | or get 8 | [nightly build](http://vsixgallery.com/extension/51b81721-cf4e-4ce0-a595-972b1ca2a186/). 9 | 10 | ## Features 11 | 12 | - Suggested extensions 13 | - Suggest missing extensions for unknown files 14 | - Installs missing extensions easily 15 | - Show a list of generally suggested extension 16 | - Solution specific extensions 17 | - The **.vsext** file 18 | - Intellisense 19 | 20 | ## Suggested extensions 21 | 22 | ### Unknown file types 23 | 24 | When you open a file type that Visual Studio doesn't provide 25 | any tooling for, a yellow info bar shows up offering 1 or more 26 | available extensions to install. 27 | 28 | ![InfoBar](art/infobar.png) 29 | 30 | You can either chose to install one or more of these extensions 31 | or chose not to be notified again for this particular file 32 | type. 33 | 34 | ### Install extensions... 35 | 36 | When clicking **Install extensions...** in the yellow info bar, 37 | you are presented with a list of extensions for the particular 38 | file type. 39 | 40 | ![Install missing extensions](art/dialog-install-missing.png) 41 | 42 | Just check the extensions you want to install and it will 43 | be installed automatically for you. After installation a new 44 | popup will appear to let you restart Visual Studio. 45 | 46 | ![Prompt for restart](art/prompt-restart.png) 47 | 48 | This is optional, but the newly installed extensions will not 49 | take effect before a restart. 50 | 51 | ### Ignore file type 52 | 53 | When clicking **Ignore file type** on the yellow info bar it 54 | will not show again for the particular info. However, you can 55 | still see the list of suggested extensions by clicking on a 56 | new button on the Standard toolbar. 57 | 58 | ![Toolbar suggested extensions](art/toolbar-suggested-extensions.png) 59 | 60 | That will show the same dialog as before, but now it will also 61 | include generally suggested extensions. 62 | 63 | ![Dialog suggested extensions](art/dialog-suggested-extensions.png) 64 | 65 | > To suggest new extensions for the list, please send a PR 66 | > to [this JSON file](https://github.com/madskristensen/SolutionExtensions/blob/master/src/JSON/Schema/suggestions.json). 67 | 68 | ## Solution specific extensions 69 | 70 | This is great for teams and open source project owners to make 71 | sure that any needed extensions are being installed by the 72 | developers opening and working on that solution. 73 | 74 | ### Mandatory and optional extensions 75 | 76 | When opening a solution in Visual Studio that has already 77 | specified which extensions the user should be using with 78 | said solution, this dialog automatically pops up. 79 | 80 | ![Dialog missing extensions](art/dialog-missing-extensions.png) 81 | 82 | The user is only prompted to install extensions if any 83 | mandatory extensions have been specified and they have not 84 | already been installed. 85 | 86 | The user can always decide not to install the extensions and 87 | even specify not to be prompted again for a specific solution. 88 | 89 | ### Specifying the solution extensions 90 | 91 | Specifying which extensions should be used with any solution 92 | is easy. Use the dropdown on the Standard toolbar to 93 | modify solution extensions. 94 | 95 | ![alt text](art/modify-solution-extensions.png) 96 | 97 | That will create a JSON file next to the solution with a 98 | **.vsext** extension. 99 | 100 | ![Extension solution file](art/vsext-on-disk.png) 101 | 102 | The **.vsext** file must have the same name as the **.sln** 103 | file. 104 | 105 | After modifying the JSON file, it could look like this: 106 | 107 | ```json 108 | { 109 | "extensions": { 110 | "mandatory": [ 111 | { 112 | "name": "EditorConfig", 113 | "productId": "EditorConfig..5cd8e6a2-be43-4fcc-a345-40f6cc1e9c9f", 114 | "link": "https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328", 115 | "description": "This makes sure that everyone uses correct spaces and indentation." 116 | }, 117 | { 118 | "name": "Extensibility Tools 2015", 119 | "productId": "f8330d54-0469-43a7-8fc0-7f19febeb897", 120 | "link": "https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6", 121 | "description": "Used for editing the '.vsct' file in the root of this project." 122 | } 123 | ], 124 | "optional": [ 125 | { 126 | "name": "YAML Editor", 127 | "productId": "YamlDotNetEditor..074a7b74-655b-409c-b5ac-a028f12d6e89", 128 | "link": "https://visualstudiogallery.msdn.microsoft.com/34423c06-f756-4721-8394-bc3d23b91ca7", 129 | "description": "This is handy for editing the 'appveyor.yml' file." 130 | } 131 | ] 132 | } 133 | } 134 | ``` 135 | 136 | ### Intellisense 137 | 138 | When editing the **.vsext** file you get full Intellisense 139 | for all your installed extensions. 140 | 141 | ![Intellisense](art/intellisense.png) 142 | 143 | It even shows the extension icons to make it easy to identify 144 | the right extensions. 145 | 146 | > The __productId__ is the `productID` or `Identifier` found 147 | > in an extension's `.vsixmanifest` file. With the Intellisense 148 | > this is all automatically discovered for you. 149 | 150 | ## Contribute 151 | 152 | The more relevant extension suggestions there are, the better 153 | this extension becomes. Please feel free to send pull requests 154 | with additional extensions to 155 | [this JSON file](https://github.com/madskristensen/SolutionExtensions/blob/master/src/JSON/Schema/suggestions.json). 156 | 157 | ## License 158 | [Apache 2.0](LICENSE) -------------------------------------------------------------------------------- /SolutionExtensions.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionExtensions", "src\SolutionExtensions.csproj", "{9B8FA5DB-89B3-4546-8835-9D4D902525F9}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C7B3FA2F-9210-4B88-8641-D81B13971B75}" 9 | ProjectSection(SolutionItems) = preProject 10 | appveyor.yml = appveyor.yml 11 | README.md = README.md 12 | SolutionExtensions.vsext = SolutionExtensions.vsext 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {9B8FA5DB-89B3-4546-8835-9D4D902525F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {9B8FA5DB-89B3-4546-8835-9D4D902525F9}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {9B8FA5DB-89B3-4546-8835-9D4D902525F9}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {9B8FA5DB-89B3-4546-8835-9D4D902525F9}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /SolutionExtensions.vsext: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "mandatory": [ 4 | { 5 | "name": "EditorConfig", 6 | "productId": "EditorConfig..5cd8e6a2-be43-4fcc-a345-40f6cc1e9c9f", 7 | "link": "https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328", 8 | "description": "This makes sure that everyone uses correct spaces and indentation." 9 | }, 10 | { 11 | "name": "Extensibility Tools 2015", 12 | "productId": "f8330d54-0469-43a7-8fc0-7f19febeb897", 13 | "link": "https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6", 14 | "description": "Used for editing the '.vsct' file in the root of this project." 15 | } 16 | ], 17 | "optional": [ 18 | { 19 | "name": "YAML Editor", 20 | "productId": "YamlDotNetEditor..074a7b74-655b-409c-b5ac-a028f12d6e89", 21 | "link": "https://visualstudiogallery.msdn.microsoft.com/34423c06-f756-4721-8394-bc3d23b91ca7", 22 | "description": "This is handy for editing the 'appveyor.yml' file." 23 | } 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2015 2 | 3 | install: 4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex 5 | 6 | before_build: 7 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion 8 | - ps: Vsix-TokenReplacement src\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' 9 | 10 | build_script: 11 | - nuget restore -Verbosity quiet 12 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m 13 | 14 | after_test: 15 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery 16 | 17 | before_deploy: 18 | - ps: Vsix-CreateChocolatyPackage -packageId suggestedextensions 19 | 20 | deploy: 21 | - provider: Environment 22 | name: Chocolatey 23 | on: 24 | branch: master 25 | appveyor_repo_commit_message_extended: /\[release\]/ -------------------------------------------------------------------------------- /art/dialog-install-missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/dialog-install-missing.png -------------------------------------------------------------------------------- /art/dialog-missing-extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/dialog-missing-extensions.png -------------------------------------------------------------------------------- /art/dialog-suggested-extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/dialog-suggested-extensions.png -------------------------------------------------------------------------------- /art/infobar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/infobar.png -------------------------------------------------------------------------------- /art/intellisense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/intellisense.png -------------------------------------------------------------------------------- /art/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/logo.png -------------------------------------------------------------------------------- /art/modify-solution-extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/modify-solution-extensions.png -------------------------------------------------------------------------------- /art/prompt-restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/prompt-restart.png -------------------------------------------------------------------------------- /art/toolbar-suggested-extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/toolbar-suggested-extensions.png -------------------------------------------------------------------------------- /art/vsext-on-disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/art/vsext-on-disk.png -------------------------------------------------------------------------------- /lib/Microsoft.JSON.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/lib/Microsoft.JSON.Core.dll -------------------------------------------------------------------------------- /lib/Microsoft.JSON.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/lib/Microsoft.JSON.Editor.dll -------------------------------------------------------------------------------- /lib/Microsoft.VisualStudio.ExtensionManager.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/lib/Microsoft.VisualStudio.ExtensionManager.dll -------------------------------------------------------------------------------- /lib/Microsoft.Web.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/SolutionExtensions/61334eb283be2314f9df48a5dfcf64578e00a51e/lib/Microsoft.Web.Editor.dll -------------------------------------------------------------------------------- /src/Commands/ModifyMissingCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Design; 3 | using System.IO; 4 | using System.Text; 5 | using EnvDTE; 6 | using EnvDTE80; 7 | using Microsoft.VisualStudio.Shell; 8 | 9 | namespace SolutionExtensions 10 | { 11 | internal sealed class ModifyMissingCommand 12 | { 13 | private readonly Package _package; 14 | 15 | private ModifyMissingCommand(Package package) 16 | { 17 | _package = package; 18 | 19 | OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; 20 | if (commandService != null) 21 | { 22 | var menuCommandID = new CommandID(PackageGuids.guidExtensionCmdSet, PackageIds.cmdCreateSolutionExtensions); 23 | var button = new OleMenuCommand(ShowDialog, menuCommandID); 24 | button.BeforeQueryStatus += BeforeQueryStatus; 25 | commandService.AddCommand(button); 26 | } 27 | } 28 | 29 | private void BeforeQueryStatus(object sender, EventArgs e) 30 | { 31 | var button = (OleMenuCommand)sender; 32 | 33 | button.Enabled = !string.IsNullOrEmpty(VSPackage.GetSolution()); 34 | } 35 | 36 | public static ModifyMissingCommand Instance { get; private set; } 37 | 38 | private IServiceProvider ServiceProvider 39 | { 40 | get { return _package; } 41 | } 42 | 43 | public static void Initialize(Package package) 44 | { 45 | Instance = new ModifyMissingCommand(package); 46 | } 47 | 48 | private void ShowDialog(object sender, EventArgs e) 49 | { 50 | string fileName = Path.ChangeExtension(VSPackage.GetSolution(), Constants.EXTENSION); 51 | 52 | if (string.IsNullOrEmpty(fileName)) 53 | return; 54 | 55 | string emptyFile = @"{ 56 | ""extensions"": { 57 | ""mandatory"": [ 58 | { 59 | ""name"": ""Web Compiler"", 60 | ""productId"": ""148ffa77-d70a-407f-892b-9ee542346862"", 61 | ""link"": ""https://visualstudiogallery.msdn.microsoft.com/3b329021-cd7a-4a01-86fc-714c2d05bb6c"", 62 | ""description"": ""We use this to compile LESS and CoffeeScript files"" 63 | } 64 | ] 65 | } 66 | }"; 67 | 68 | if (!File.Exists(fileName)) 69 | File.WriteAllText(fileName, emptyFile, new UTF8Encoding(true)); 70 | 71 | var dte = ServiceProvider.GetService(typeof(DTE)) as DTE2; 72 | dte.ItemOperations.OpenFile(fileName); 73 | } 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/Commands/ShowMissingCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Design; 3 | using System.IO; 4 | using Microsoft.VisualStudio.Shell; 5 | 6 | namespace SolutionExtensions 7 | { 8 | internal sealed class ShowMissingCommand 9 | { 10 | private readonly Package _package; 11 | private OleMenuCommand _button; 12 | 13 | private ShowMissingCommand(Package package) 14 | { 15 | _package = package; 16 | SolutionHandler.ExtensionFileFound += ExtensionFileFound; 17 | SolutionHandler.SolutionClosed += SolutionClosed; 18 | 19 | OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; 20 | if (commandService != null) 21 | { 22 | var menuCommandID = new CommandID(PackageGuids.guidExtensionCmdSet, PackageIds.cmdShowMissing); 23 | _button = new OleMenuCommand(async (s, e) => await ShowDialog(s, e), menuCommandID); 24 | _button.BeforeQueryStatus += _button_BeforeQueryStatus; 25 | commandService.AddCommand(_button); 26 | } 27 | } 28 | 29 | private void _button_BeforeQueryStatus(object sender, EventArgs e) 30 | { 31 | var button = (OleMenuCommand)sender; 32 | button.Enabled = false; 33 | 34 | string solution = VSPackage.GetSolution(); 35 | 36 | if (string.IsNullOrEmpty(solution)) 37 | return; 38 | 39 | string fileName = Path.ChangeExtension(solution, Constants.EXTENSION); 40 | 41 | button.Enabled = File.Exists(fileName); 42 | } 43 | 44 | private void SolutionClosed(object sender, EventArgs e) 45 | { 46 | if (_button != null) 47 | { 48 | _button.Enabled = false; 49 | } 50 | } 51 | 52 | private void ExtensionFileFound(object sender, ExtensionFileEventArgs e) 53 | { 54 | if (_button != null) 55 | { 56 | _button.Enabled = e.Model != null; 57 | } 58 | } 59 | 60 | public static ShowMissingCommand Instance { get; private set; } 61 | 62 | private IServiceProvider ServiceProvider 63 | { 64 | get { return _package; } 65 | } 66 | 67 | public static void Initialize(Package package) 68 | { 69 | Instance = new ShowMissingCommand(package); 70 | } 71 | 72 | private async System.Threading.Tasks.Task ShowDialog(object sender, EventArgs e) 73 | { 74 | ExtensionFileModel fileModel = await SolutionHandler.Instance.GetCurrentFileModel(); 75 | 76 | if (fileModel != null) 77 | { 78 | await ExtensionInstalledChecker.Instance.ShowDialog(fileModel); 79 | } 80 | } 81 | } 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/Commands/ShowSuggestionsCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Design; 4 | using System.IO; 5 | using System.Windows.Interop; 6 | using EnvDTE; 7 | using EnvDTE80; 8 | using Microsoft.VisualStudio.ExtensionManager; 9 | using Microsoft.VisualStudio.Shell; 10 | 11 | namespace SolutionExtensions 12 | { 13 | internal sealed class ShowSuggestionsCommand 14 | { 15 | private readonly Package _package; 16 | private IVsExtensionRepository _repository; 17 | private IVsExtensionManager _manager; 18 | 19 | private ShowSuggestionsCommand(Package package, IVsExtensionRepository repository, IVsExtensionManager manager) 20 | { 21 | _package = package; 22 | _repository = repository; 23 | _manager = manager; 24 | 25 | OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; 26 | if (commandService != null) 27 | { 28 | var menuCommandID = new CommandID(PackageGuids.guidExtensionCmdSet, PackageIds.cmdShowSuggestions); 29 | var button = new OleMenuCommand(async (s, e) => await ShowSuggestions(s, e), menuCommandID); 30 | commandService.AddCommand(button); 31 | } 32 | } 33 | 34 | public static ShowSuggestionsCommand Instance { get; private set; } 35 | 36 | private IServiceProvider ServiceProvider 37 | { 38 | get { return _package; } 39 | } 40 | 41 | public static void Initialize(Package package, IVsExtensionRepository repository, IVsExtensionManager manager) 42 | { 43 | Instance = new ShowSuggestionsCommand(package, repository, manager); 44 | } 45 | 46 | private async System.Threading.Tasks.Task ShowSuggestions(object sender, EventArgs e) 47 | { 48 | var dte = ServiceProvider.GetService(typeof(DTE)) as DTE2; 49 | 50 | SuggestionResult result; 51 | 52 | if (dte.ActiveDocument != null && !string.IsNullOrEmpty(dte.ActiveDocument.FullName)) 53 | { 54 | IEnumerable fileTypes; 55 | result = SuggestionHandler.Instance.GetSuggestions(dte.ActiveDocument.FullName, out fileTypes); 56 | } 57 | else 58 | { 59 | result = new SuggestionResult 60 | { 61 | Extensions = SuggestionHandler.Instance.GetCurrentFileModel().Extensions[SuggestionFileModel.GENERAL], 62 | Matches = new string[0] 63 | }; 64 | } 65 | 66 | if (result != null) 67 | { 68 | InstallerDialog dialog = new InstallerDialog(result.Extensions); 69 | var hwnd = new IntPtr(dte.MainWindow.HWnd); 70 | System.Windows.Window window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual; 71 | dialog.Owner = window; 72 | dialog.NeverShowAgainForSolution = Settings.IsFileTypeIgnored(result.Matches); 73 | var test = dialog.ShowDialog(); 74 | 75 | Settings.IgnoreFileType(result.Matches, dialog.NeverShowAgainForSolution); 76 | 77 | if (!test.HasValue || !test.Value) 78 | return; 79 | 80 | ExtensionInstaller installer = new ExtensionInstaller(_package, _repository, _manager); 81 | await installer.InstallExtensions(dialog.SelectedExtensions); 82 | } 83 | } 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/Commands/SolutionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading.Tasks; 4 | using EnvDTE; 5 | using EnvDTE80; 6 | 7 | namespace SolutionExtensions 8 | { 9 | class SolutionHandler 10 | { 11 | private DTE2 _dte; 12 | private SolutionEvents _events; 13 | 14 | private SolutionHandler(DTE2 dte) 15 | { 16 | _dte = dte; 17 | _events = _dte.Events.SolutionEvents; 18 | _events.Opened += OnSolutionOpened; 19 | _events.AfterClosing += OnSolutionClosed; 20 | } 21 | 22 | public static SolutionHandler Instance { get; private set; } 23 | 24 | public static void Initialize(DTE2 dte) 25 | { 26 | Instance = new SolutionHandler(dte); 27 | } 28 | 29 | private async void OnSolutionOpened() 30 | { 31 | if (ExtensionFileFound != null) 32 | { 33 | ExtensionFileModel model = await GetCurrentFileModel(); 34 | 35 | if (model != null) 36 | { 37 | ExtensionFileFound(this, new ExtensionFileEventArgs(model)); 38 | } 39 | } 40 | } 41 | 42 | public async Task GetCurrentFileModel() 43 | { 44 | if (_dte.Solution == null || string.IsNullOrEmpty(_dte.Solution.FullName)) 45 | return null; 46 | 47 | string configPath = Path.ChangeExtension(_dte.Solution.FullName, Constants.EXTENSION); 48 | 49 | return await ExtensionFileModel.FromFile(configPath); 50 | } 51 | 52 | private void OnSolutionClosed() 53 | { 54 | if (SolutionClosed != null) 55 | { 56 | SolutionClosed(this, EventArgs.Empty); 57 | } 58 | } 59 | 60 | public static event EventHandler ExtensionFileFound; 61 | public static event EventHandler SolutionClosed; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Constants.cs: -------------------------------------------------------------------------------- 1 | public class Constants 2 | { 3 | public const string EXTENSION = ".vsext"; 4 | public const string SUGGESTIONS_FILENAME = "suggestions.json"; 5 | } 6 | -------------------------------------------------------------------------------- /src/ExtensionManager/ExtensionInstalledChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Interop; 6 | using EnvDTE; 7 | using EnvDTE80; 8 | using Microsoft.VisualStudio.ExtensionManager; 9 | 10 | namespace SolutionExtensions 11 | { 12 | public class ExtensionInstalledChecker 13 | { 14 | private IServiceProvider _serviceProvider; 15 | private IVsExtensionRepository _repository; 16 | private IVsExtensionManager _manager; 17 | private static IEnumerable _cache; 18 | 19 | private ExtensionInstalledChecker(IServiceProvider serviceProvider, IVsExtensionRepository repository, IVsExtensionManager manager) 20 | { 21 | _serviceProvider = serviceProvider; 22 | _repository = repository; 23 | _manager = manager; 24 | 25 | SolutionHandler.ExtensionFileFound += ExtensionFileFound; 26 | } 27 | 28 | public static ExtensionInstalledChecker Instance { get; private set; } 29 | 30 | public static void Initialize(IServiceProvider serviceProvider, IVsExtensionRepository repository, IVsExtensionManager manager) 31 | { 32 | Instance = new ExtensionInstalledChecker(serviceProvider, repository, manager); 33 | } 34 | 35 | private async void ExtensionFileFound(object sender, ExtensionFileEventArgs e) 36 | { 37 | string solution = VSPackage.GetSolution(); 38 | 39 | if (!Settings.IsSolutionIgnored()) 40 | { 41 | bool missingExtensions = await HasMissingExtensions(e.Model); 42 | 43 | if (missingExtensions) 44 | await ShowDialog(e.Model); 45 | } 46 | } 47 | 48 | public async Task ShowDialog(ExtensionFileModel model) 49 | { 50 | var extensions = model.Extensions.SelectMany(e => e.Value); 51 | 52 | InstallerDialog dialog = new InstallerDialog(extensions); 53 | dialog.Title = "Solution specific extensions"; 54 | dialog.NeverShowAgainForSolution = Settings.IsSolutionIgnored(); 55 | 56 | var dte = _serviceProvider.GetService(typeof(DTE)) as DTE2; 57 | var hwnd = new IntPtr(dte.MainWindow.HWnd); 58 | System.Windows.Window window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual; 59 | dialog.Owner = window; 60 | 61 | var result = dialog.ShowDialog(); 62 | 63 | Settings.IgnoreSolution(dialog.NeverShowAgainForSolution); 64 | 65 | if (!result.HasValue || !result.Value) 66 | return; 67 | 68 | ExtensionInstaller installer = new ExtensionInstaller(_serviceProvider, _repository, _manager); 69 | await installer.InstallExtensions(dialog.SelectedExtensions); 70 | } 71 | 72 | private async Task HasMissingExtensions(ExtensionFileModel model) 73 | { 74 | return await Task.Run(() => 75 | { 76 | List models = new List(); 77 | var installedExtensions = GetInstalledExtensions(); 78 | 79 | var extensions = model.Extensions.Where(cat => cat.Key == "mandatory").SelectMany(e => e.Value); 80 | 81 | foreach (var extension in extensions) 82 | { 83 | var installed = installedExtensions.FirstOrDefault(ins => ins.Header.Identifier.Equals(extension.ProductId, StringComparison.OrdinalIgnoreCase)); 84 | 85 | if (installed == null) 86 | return true; 87 | } 88 | 89 | return false; 90 | }); 91 | } 92 | 93 | public IEnumerable GetInstalledExtensions() 94 | { 95 | if (_cache == null) 96 | { 97 | _cache = _manager.GetInstalledExtensions().Where(e => !e.Header.SystemComponent && !e.Header.InstalledByMsi); 98 | } 99 | 100 | return _cache; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/ExtensionManager/ExtensionInstaller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows; 6 | using Microsoft.VisualStudio.ExtensionManager; 7 | using Microsoft.VisualStudio.Shell.Interop; 8 | 9 | namespace SolutionExtensions 10 | { 11 | public class ExtensionInstaller 12 | { 13 | private IVsExtensionRepository _repository; 14 | private IVsExtensionManager _manager; 15 | private InstallerProgress _progress; 16 | private IServiceProvider _serviceProvider; 17 | 18 | public ExtensionInstaller(IServiceProvider serviceProvider, IVsExtensionRepository repository, IVsExtensionManager manager) 19 | { 20 | _serviceProvider = serviceProvider; 21 | _repository = repository; 22 | _manager = manager; 23 | } 24 | 25 | public async Task InstallExtensions(IEnumerable extensionModels) 26 | { 27 | bool hasInstalled = false; 28 | int count = extensionModels.Count(); 29 | 30 | _progress = new InstallerProgress(count, $"Downloading and installing {count} extension(s)..."); 31 | _progress.Show(); 32 | 33 | await Task.Run(() => 34 | { 35 | foreach (IExtensionModel model in extensionModels) 36 | { 37 | try 38 | { 39 | GalleryEntry entry = _repository.CreateQuery(includeTypeInQuery: false, includeSkuInQuery: true, searchSource: "ExtensionManagerUpdate") 40 | .Where(e => e.VsixID == model.ProductId) 41 | .AsEnumerable() 42 | .FirstOrDefault(); 43 | 44 | if (!_progress.IsVisible) 45 | break; 46 | 47 | if (entry != null) 48 | { 49 | IInstallableExtension installable = _repository.Download(entry); 50 | 51 | if (!_progress.IsVisible) 52 | break; 53 | 54 | _manager.Install(installable, false); 55 | hasInstalled = true; 56 | 57 | var props = new Dictionary { { "extension", model.Name } }; 58 | } 59 | } 60 | catch (Exception ex) 61 | { 62 | Logger.Log(ex); 63 | } 64 | } 65 | }); 66 | 67 | if (_progress.IsVisible) 68 | { 69 | _progress.Close(); 70 | _progress = null; 71 | } 72 | 73 | if (hasInstalled) 74 | PromptForRestart(); 75 | } 76 | 77 | private void PromptForRestart() 78 | { 79 | string prompt = "You must restart Visual Studio for the extensions to be loaded.\r\rRestart now?"; 80 | var result = MessageBox.Show(prompt, Vsix.Name, MessageBoxButton.YesNo, MessageBoxImage.Question); 81 | 82 | if (result == MessageBoxResult.Yes) 83 | { 84 | IVsShell4 shell = (IVsShell4)_serviceProvider.GetService(typeof(SVsShell)); 85 | shell.Restart((uint)__VSRESTARTTYPE.RESTART_Normal); 86 | 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/ExtensionManager/GalleryEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.ExtensionManager; 3 | 4 | namespace SolutionExtensions 5 | { 6 | public class GalleryEntry : IRepositoryEntry 7 | { 8 | private Version _nonNullVsixVersion; 9 | 10 | public string VsixID { get; set; } 11 | public string DownloadUrl { get; set; } 12 | public string DownloadUpdateUrl { get; set; } 13 | public string VsixReferences { get; set; } 14 | public string VsixVersion { get; set; } 15 | public string Name { get; set; } 16 | public int Ranking { get; set; } 17 | 18 | public Version NonNullVsixVersion 19 | { 20 | get 21 | { 22 | if (_nonNullVsixVersion == null) 23 | { 24 | if (!Version.TryParse(VsixVersion, out _nonNullVsixVersion)) 25 | { 26 | _nonNullVsixVersion = new Version(); 27 | } 28 | } 29 | 30 | return _nonNullVsixVersion; 31 | } 32 | } 33 | 34 | public override string ToString() 35 | { 36 | return Name; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/ExtensionManager/InstallProgressEventAgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.ExtensionManager; 3 | 4 | namespace SolutionExtensions 5 | { 6 | public class InstallerProgressEventArgs : EventArgs 7 | { 8 | 9 | public InstallerProgressEventArgs(InstallCompletedEventArgs evtArgs, int total, int amountInstalled) 10 | { 11 | if (evtArgs != null) 12 | { 13 | Name = evtArgs.Extension.Header.Name; 14 | Error = evtArgs.Error; 15 | } 16 | 17 | Total = total; 18 | AmountInstalled = amountInstalled; 19 | } 20 | 21 | public Exception Error { get; set; } 22 | 23 | public string Name { get; set; } 24 | 25 | public int Total { get; set; } 26 | 27 | public int AmountInstalled { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/ExtensionManager/InstallerDialog.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |