├── docs ├── v1 │ ├── styles │ │ ├── main.css │ │ ├── main.js │ │ └── search-worker.js │ ├── favicon.ico │ ├── images │ │ └── details1_image.png │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── toc.html │ ├── articles │ │ ├── toc.html │ │ ├── details2.html │ │ ├── details3.html │ │ ├── intro.html │ │ └── details1.html │ ├── logo.svg │ ├── search-stopwords.json │ ├── index.html │ └── api │ │ ├── index.html │ │ ├── System.html │ │ ├── Microsoft.VisualStudio.Text.html │ │ ├── Microsoft.VisualStudio.Shell.html │ │ ├── Microsoft.VisualStudio.Shell.Interop.html │ │ ├── Microsoft.VisualStudio.Imaging.Interop.html │ │ ├── EnvDTE.html │ │ └── Community.VisualStudio.Toolkit.StatusAnimation.html ├── articles │ ├── intro.md │ ├── details2.md │ ├── details3.md │ ├── details1.md │ └── toc.yml ├── build_docs.cmd ├── toc.yml ├── images │ └── details1_image.png ├── .gitignore ├── index.html ├── index.md ├── api │ └── index.md └── docfx.json ├── src ├── Icon.png ├── AssemblyInfo.cs ├── Community.VisualStudio.Toolkit.props ├── Community.VisualStudio.Toolkit.Shared │ ├── Themes │ │ └── ToolkitResourceKeys.cs │ ├── ToolWindows │ │ ├── IToolWindowProvider.cs │ │ ├── WindowGuids.cs │ │ └── BaseToolWindow.cs │ ├── Services │ │ ├── Debugger.cs │ │ ├── Windows.cs │ │ ├── Editor.cs │ │ ├── Shell.cs │ │ ├── Events.cs │ │ └── Solution.cs │ ├── Commands │ │ ├── Commanding.cs │ │ └── CommandBase.cs │ ├── Community.VisualStudio.Toolkit.Shared.shproj │ ├── ExtensionMethods │ │ ├── TaskExtensions.cs │ │ ├── TextBufferExtensions.cs │ │ ├── ProjectItemExtensions.cs │ │ ├── ImageMonikerExtensions.cs │ │ ├── ExceptionExtensions.cs │ │ ├── IVsSolutionExtensions.cs │ │ └── ProjectExtensions.cs │ ├── Options │ │ └── BaseOptionPage.cs │ ├── Helpers │ │ └── ProjectTypes.cs │ ├── Notifications │ │ ├── Notifications.cs │ │ ├── MessageBox.cs │ │ └── Statusbar.cs │ ├── VS.cs │ ├── VSSDK.Helpers.Shared.projitems │ └── ToolkitPackage.cs ├── Community.VisualStudio.Toolkit.15.0 │ └── Community.VisualStudio.Toolkit.15.0.csproj ├── Community.VisualStudio.Toolkit.16.0 │ └── Community.VisualStudio.Toolkit.16.0.csproj ├── Community.VisualStudio.Toolkit.14.0 │ └── Community.VisualStudio.Toolkit.14.0.csproj └── Common.props ├── README.md ├── test └── VSSDK.TestExtension │ ├── Properties │ └── AssemblyInfo.cs │ ├── ToolWindows │ ├── ThemeWindowControl.xaml.cs │ ├── ThemeWindowDialog.xaml.cs │ ├── MultiInstanceWindowControl.xaml.cs │ ├── ThemeWindowDialogViewModel.cs │ ├── ThemeWindowDemo.xaml.cs │ ├── ThemeWindowControlViewModel.cs │ ├── MultiInstanceWindowControl.xaml │ ├── ThemeWindow.cs │ ├── MultiInstanceWindow.cs │ ├── RunnerWindowControl.xaml.cs │ ├── RunnerWindow.cs │ ├── RunnerWindowControl.xaml │ ├── ThemeWindowDialog.xaml │ ├── ThemeWindowControl.xaml │ └── ThemeWindowDemo.xaml │ ├── Commands │ ├── TestCommand.cs │ ├── ThemeWindowCommand.cs │ ├── RunnerWindowCommand.cs │ └── MultiInstanceWindowCommand.cs │ ├── Options │ └── General.cs │ ├── source.extension.vsixmanifest │ ├── VSCommandTable.cs │ ├── VSSDK.TestExtensionPackage.cs │ └── VSCommandTable.vsct ├── LICENSE ├── appveyor.yml ├── .gitattributes ├── Community.VisualStudio.Toolkit.sln ├── .editorconfig └── .gitignore /docs/v1/styles/main.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/articles/intro.md: -------------------------------------------------------------------------------- 1 | 2 | # Add your introductions here! 3 | -------------------------------------------------------------------------------- /docs/build_docs.cmd: -------------------------------------------------------------------------------- 1 | choco install docfx --confirm 2 | 3 | docfx -------------------------------------------------------------------------------- /docs/articles/details2.md: -------------------------------------------------------------------------------- 1 | Introduction 2 | ------------ 3 | 4 | This is a introduction -------------------------------------------------------------------------------- /docs/articles/details3.md: -------------------------------------------------------------------------------- 1 | Introduction 2 | ------------ 3 | 4 | This is a introduction -------------------------------------------------------------------------------- /src/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/src/Icon.png -------------------------------------------------------------------------------- /docs/v1/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/v1/favicon.ico -------------------------------------------------------------------------------- /docs/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Articles 2 | href: articles/ 3 | - name: Api Documentation 4 | href: api/ 5 | homepage: api/index.md 6 | -------------------------------------------------------------------------------- /docs/articles/details1.md: -------------------------------------------------------------------------------- 1 | Details1 2 | ------------ 3 | 4 | This is a detailed description. 5 | ![Image](../images/details1_image.png) -------------------------------------------------------------------------------- /docs/images/details1_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/images/details1_image.png -------------------------------------------------------------------------------- /docs/v1/images/details1_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/v1/images/details1_image.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Community toolkit for Visual Studio extensions 2 | 3 | This repo has moved to https://github.com/VsixCommunity/Community.VisualStudio.Toolkit 4 | -------------------------------------------------------------------------------- /docs/v1/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/v1/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/v1/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/v1/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/v1/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/v1/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/v1/styles/main.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. 2 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Shell; 2 | 3 | [assembly: ProvideCodeBase(AssemblyName = "Community.VisualStudio.Toolkit")] 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # folder # 3 | ############### 4 | /**/DROP/ 5 | /**/TEMP/ 6 | /**/packages/ 7 | /**/bin/ 8 | /**/obj/ 9 | api/* 10 | !api/*.md 11 | -------------------------------------------------------------------------------- /docs/v1/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/Community.VisualStudio.Toolkit/master/docs/v1/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /docs/articles/toc.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Introduction 3 | href: intro.md 4 | - name: Details 1 5 | href: details1.md 6 | - name: Details 2 7 | href: details2.md 8 | - name: Details 3 9 | href: details3.md -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Please follow this link.

8 | 9 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # This is the **HOMEPAGE**. 2 | Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. 3 | ## Quick Start Notes: 4 | 1. Add images to the *images* folder if the file is referencing an image. 5 | -------------------------------------------------------------------------------- /docs/api/index.md: -------------------------------------------------------------------------------- 1 | # This is the **HOMEPAGE**. 2 | Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. 3 | ## Quick Start Notes: 4 | 1. Add images to the *images* folder if the file is referencing an image. 5 | -------------------------------------------------------------------------------- /src/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This will add the toolkit assembly to Visual Studio's probing path. 2 | // Without it, Visual Studio is unable to find the assembly and the extension will fail to load. 3 | using Microsoft.VisualStudio.Shell; 4 | 5 | [assembly: ProvideCodeBase(AssemblyName = "Community.VisualStudio.Toolkit")] 6 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/ThemeWindowControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace TestExtension 4 | { 5 | public partial class ThemeWindowControl : UserControl 6 | { 7 | public ThemeWindowControl() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/ThemeWindowDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.PlatformUI; 2 | 3 | namespace TestExtension 4 | { 5 | public partial class ThemeWindowDialog : DialogWindow 6 | { 7 | public ThemeWindowDialog() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/MultiInstanceWindowControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace TestExtension 4 | { 5 | public partial class MultiInstanceWindowControl : UserControl 6 | { 7 | public MultiInstanceWindowControl(int toolWindowId) 8 | { 9 | InitializeComponent(); 10 | lblWindowId.Content = toolWindowId; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/ThemeWindowDialogViewModel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.PlatformUI; 2 | 3 | namespace TestExtension 4 | { 5 | public class ThemeWindowDialogViewModel : ObservableObject 6 | { 7 | private bool _useVsTheme = true; 8 | 9 | public bool UseVsTheme 10 | { 11 | get { return _useVsTheme; } 12 | set { SetProperty(ref _useVsTheme, value); } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Community.VisualStudio.Toolkit.dll 7 | true 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/Themes/ToolkitResourceKeys.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Community.VisualStudio.Toolkit 4 | { 5 | /// Exposes WPF resource keys for WPF controls. 6 | public static class ToolkitResourceKeys 7 | { 8 | /// Gets the key that can be used to get the to use for input controls. 9 | public static object InputPaddingKey { get; } = "Toolkit" + nameof(InputPaddingKey); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/ToolWindows/IToolWindowProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using System.Windows; 5 | 6 | namespace Community.VisualStudio.Toolkit 7 | { 8 | internal interface IToolWindowProvider 9 | { 10 | public string GetTitle(int toolWindowId); 11 | 12 | public Type PaneType { get; } 13 | 14 | public Task CreateAsync(int toolWindowId, CancellationToken cancellationToken); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/Commands/TestCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.Shell; 3 | using Community.VisualStudio.Toolkit; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace TestExtension 7 | { 8 | public class TestCommand : BaseCommand 9 | { 10 | public TestCommand() 11 | : base(new Guid("489ba882-f600-4c8b-89db-eb366a4ee3b3"), 0x0001) { } 12 | 13 | protected override Task ExecuteAsync(OleMenuCmdEventArgs e) 14 | { 15 | return base.ExecuteAsync(e); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017 LigerShark 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. -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/Commands/ThemeWindowCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Community.VisualStudio.Toolkit; 3 | using Microsoft.VisualStudio.Shell; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace TestExtension 7 | { 8 | internal sealed class ThemeWindowCommand : BaseCommand 9 | { 10 | public ThemeWindowCommand() : base(new Guid("cb765f49-fc35-4c14-93af-bb48ca4f2ce3"), 0x0101) 11 | { } 12 | 13 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 14 | { 15 | await ThemeWindow.ShowAsync(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/Commands/RunnerWindowCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Community.VisualStudio.Toolkit; 3 | using Microsoft.VisualStudio.Shell; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace TestExtension 7 | { 8 | internal sealed class RunnerWindowCommand : BaseCommand 9 | { 10 | public RunnerWindowCommand() : base(new Guid("cb765f49-fc35-4c14-93af-bb48ca4f2ce3"), 0x0100) 11 | { } 12 | 13 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 14 | { 15 | await RunnerWindow.ShowAsync(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.15.0/Community.VisualStudio.Toolkit.15.0.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net46 7 | 15.0 8 | VS15 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.16.0/Community.VisualStudio.Toolkit.16.0.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net472 7 | 16.0 8 | VS16 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.14.0/Community.VisualStudio.Toolkit.14.0.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net46 7 | 14.0 8 | VS14 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/ThemeWindowDemo.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace TestExtension 17 | { 18 | public partial class ThemeWindowDemo : UserControl 19 | { 20 | public ThemeWindowDemo() 21 | { 22 | InitializeComponent(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/ThemeWindowControlViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | using Microsoft.VisualStudio.PlatformUI; 4 | 5 | namespace TestExtension 6 | { 7 | public class ThemeWindowControlViewModel : ObservableObject 8 | { 9 | private bool _useVsTheme = true; 10 | 11 | public bool UseVsTheme 12 | { 13 | get { return _useVsTheme; } 14 | set { SetProperty(ref _useVsTheme, value); } 15 | } 16 | 17 | public ICommand OpenDialogCommand => new DelegateCommand(() => OpenDialog()); 18 | 19 | private void OpenDialog() 20 | { 21 | var dialog = new ThemeWindowDialog { DataContext = new ThemeWindowDialogViewModel { UseVsTheme = UseVsTheme } }; 22 | dialog.ShowModal(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/MultiInstanceWindowControl.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/v1/toc.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 14 | 22 |
23 |
24 |
25 |
-------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/Services/Debugger.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.VisualStudio.Shell.Interop; 3 | 4 | namespace Community.VisualStudio.Toolkit 5 | { 6 | /// A collection of services related to debugging. 7 | public class Debugger 8 | { 9 | internal Debugger() 10 | { } 11 | 12 | /// Provides access to the current debugger so that the package can listen for debugger events. 13 | public Task GetDebuggerAsync() => VS.GetServiceAsync(); 14 | 15 | /// Used to launch the debugger. 16 | public Task GetDebugLaunchAsync() => VS.GetServiceAsync(); 17 | 18 | /// Allows clients to add to the debuggable protocol list.` 19 | public Task GetDebuggableProtocolAsync() => VS.GetServiceAsync(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/Commands/Commanding.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Design; 2 | using System.Threading.Tasks; 3 | using Microsoft.VisualStudio.Shell.Interop; 4 | 5 | namespace Community.VisualStudio.Toolkit 6 | { 7 | /// A collection of services related to the command system. 8 | public class Commanding 9 | { 10 | internal Commanding() 11 | { } 12 | 13 | /// Provides methods to manage the global designer verbs and menu commands available in design mode, and to show some types of shortcut menus. 14 | public Task GetCommandServiceAsync() => VS.GetServiceAsync(); 15 | 16 | /// Used to register and unregister a command target as a high priority command handler. 17 | public Task GetPriorityCommandTargetAsync() => VS.GetServiceAsync(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/Commands/MultiInstanceWindowCommand.cs: -------------------------------------------------------------------------------- 1 | using Community.VisualStudio.Toolkit; 2 | using Microsoft.VisualStudio.Shell; 3 | using Task = System.Threading.Tasks.Task; 4 | 5 | namespace TestExtension 6 | { 7 | internal sealed class MultiInstanceWindowCommand : BaseCommand 8 | { 9 | public MultiInstanceWindowCommand() 10 | : base(PackageGuids.guidTestExtensionPackageCmdSet, PackageIds.MultiInstanceWindowCommandId) { } 11 | 12 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 13 | { 14 | // Create the window with the first free ID. 15 | for (var i = 0; i < 10; i++) 16 | { 17 | ToolWindowPane window = await MultiInstanceWindow.ShowAsync(id: i, create: false); 18 | 19 | if (window == null) 20 | { 21 | await MultiInstanceWindow.ShowAsync(id: i, create: true); 22 | break; 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/Options/General.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Community.VisualStudio.Toolkit; 3 | using Microsoft.VisualStudio.Shell; 4 | 5 | namespace TestExtension 6 | { 7 | internal partial class OptionsProvider 8 | { 9 | // Register the options with these attributes in your package class: 10 | // [ProvideOptionPage(typeof(OptionsProvider.GeneralOptions), "My options", "General", 0, 0, true)] 11 | // [ProvideProfile(typeof(OptionsProvider.GeneralOptions), "My options", "General", 0, 0, true)] 12 | public class GeneralOptions : BaseOptionPage { } 13 | } 14 | 15 | public class General : BaseOptionModel 16 | { 17 | [Category("My category")] 18 | [DisplayName("My Options")] 19 | [Description("An informative description.")] 20 | [DefaultValue(true)] 21 | public bool MyOption { get; set; } = true; 22 | 23 | public General() : base() 24 | { 25 | Saved += delegate { VS.Notifications.SetStatusbarTextAsync("Options Saved").FireAndForget(); }; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": [ 3 | { 4 | "src": [ 5 | { 6 | "src": "../", 7 | "files": "src/Community.VisualStudio.Toolkit.16.0/Community.VisualStudio.Toolkit.16.0.csproj" 8 | } 9 | ], 10 | "dest": "api" 11 | } 12 | ], 13 | "build": { 14 | "content": [ 15 | { 16 | "files": [ 17 | "api/**.yml", 18 | "api/index.md", 19 | "api-vb/**.yml" 20 | ] 21 | }, 22 | { 23 | "files": [ 24 | "articles/**.md", 25 | "articles/**/toc.yml", 26 | "toc.yml", 27 | "*.md" 28 | ], 29 | "exclude": [ 30 | "**/bin/**", 31 | "**/obj/**", 32 | "_site/**" 33 | ] 34 | } 35 | ], 36 | "resource": [ 37 | { 38 | "files": [ 39 | "images/**" 40 | ], 41 | "exclude": [ 42 | "**/bin/**", 43 | "**/obj/**", 44 | "_site/**" 45 | ] 46 | } 47 | ], 48 | "dest": "v1", 49 | "template": [ 50 | "default" 51 | ] 52 | } 53 | } -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/Community.VisualStudio.Toolkit.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5ec463ac-24cb-443e-9ff9-91b7ecb1f822 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/ThemeWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using System.Windows; 6 | using Community.VisualStudio.Toolkit; 7 | using Microsoft.VisualStudio.Imaging; 8 | using Microsoft.VisualStudio.Shell; 9 | using Task = System.Threading.Tasks.Task; 10 | 11 | namespace TestExtension 12 | { 13 | public class ThemeWindow : BaseToolWindow 14 | { 15 | public override string GetTitle(int toolWindowId) => "Theme Window"; 16 | 17 | public override Type PaneType => typeof(Pane); 18 | 19 | public override Task CreateAsync(int toolWindowId, CancellationToken cancellationToken) 20 | { 21 | return Task.FromResult(new ThemeWindowControl { DataContext = new ThemeWindowControlViewModel() }); 22 | } 23 | 24 | [Guid("e3be6dd3-f017-4d6e-ae88-2b29319a77a2")] 25 | public class Pane : ToolWindowPane 26 | { 27 | public Pane() 28 | { 29 | BitmapImageMoniker = KnownMonikers.ColorPalette; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/MultiInstanceWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using System.Windows; 6 | using Community.VisualStudio.Toolkit; 7 | using Microsoft.VisualStudio.Imaging; 8 | using Microsoft.VisualStudio.Shell; 9 | using Task = System.Threading.Tasks.Task; 10 | 11 | namespace TestExtension 12 | { 13 | public class MultiInstanceWindow : BaseToolWindow 14 | { 15 | public override string GetTitle(int toolWindowId) => $"Multi Instance Window #{toolWindowId}"; 16 | 17 | public override Type PaneType => typeof(Pane); 18 | 19 | public override Task CreateAsync(int toolWindowId, CancellationToken cancellationToken) 20 | { 21 | return Task.FromResult(new MultiInstanceWindowControl(toolWindowId)); 22 | } 23 | 24 | [Guid("13dccc25-9d1d-417d-8525-40c4c14ff0a2")] 25 | public class Pane : ToolWindowPane 26 | { 27 | public Pane() 28 | { 29 | BitmapImageMoniker = KnownMonikers.MultiView; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/v1/articles/toc.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 14 | 28 |
29 |
30 |
31 |
-------------------------------------------------------------------------------- /test/VSSDK.TestExtension/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | VSSDK.TestExtension 6 | Empty VSIX Project. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/ExtensionMethods/TaskExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Microsoft.VisualStudio.Shell 4 | { 5 | /// Extension methods for the object. 6 | public static class TaskExtensions 7 | { 8 | /// 9 | /// Starts a Task and lets it run in the background, while silently handles any exceptions. 10 | /// 11 | /// 12 | /// This is similar to the task.FileAndForget(string) method introduced in 16.0, but this doesn't record 13 | /// telemetry on faults and it doesn't take a string parameter. This also works in all version of Visual Studio. 14 | /// 15 | public static void FireAndForget(this System.Threading.Tasks.Task task) 16 | { 17 | ThreadHelper.JoinableTaskFactory.RunAsync(async () => 18 | { 19 | try 20 | { 21 | await task.ConfigureAwait(false); 22 | } 23 | catch (Exception ex) 24 | { 25 | await ex.LogAsync(); 26 | } 27 | }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Community.VisualStudio.Toolkit.Shared/Options/BaseOptionPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Shell; 2 | 3 | namespace Community.VisualStudio.Toolkit 4 | { 5 | /// 6 | /// A base class for a DialogPage to show in Tools -> Options. 7 | /// 8 | public class BaseOptionPage : DialogPage where T : BaseOptionModel, new() 9 | { 10 | private readonly BaseOptionModel _model; 11 | 12 | /// 13 | /// Creates a new instance of the options page. 14 | /// 15 | public BaseOptionPage() 16 | { 17 | _model = ThreadHelper.JoinableTaskFactory.Run(BaseOptionModel.CreateAsync); 18 | } 19 | 20 | /// The model object to load and store. 21 | public override object AutomationObject => _model; 22 | 23 | /// Loads the settings from the internal storage. 24 | public override void LoadSettingsFromStorage() 25 | { 26 | _model.Load(); 27 | } 28 | 29 | /// Saves settings to the internal storage. 30 | public override void SaveSettingsToStorage() 31 | { 32 | _model.Save(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/VSCommandTable.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace TestExtension 7 | { 8 | using System; 9 | 10 | /// 11 | /// Helper class that exposes all GUIDs used across VS Package. 12 | /// 13 | internal sealed partial class PackageGuids 14 | { 15 | public const string guidPackageString = "05271709-8845-42fb-9d10-621cc8cffc5d"; 16 | public static Guid guidPackage = new Guid(guidPackageString); 17 | 18 | public const string guidTestExtensionPackageCmdSetString = "cb765f49-fc35-4c14-93af-bb48ca4f2ce3"; 19 | public static Guid guidTestExtensionPackageCmdSet = new Guid(guidTestExtensionPackageCmdSetString); 20 | } 21 | /// 22 | /// Helper class that encapsulates all CommandIDs uses across VS Package. 23 | /// 24 | internal sealed partial class PackageIds 25 | { 26 | public const int RunnerWindowCommandId = 0x0100; 27 | public const int ThemeWindowCommandId = 0x0101; 28 | public const int MultiInstanceWindowCommandId = 0x0102; 29 | } 30 | } -------------------------------------------------------------------------------- /docs/v1/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by Docfx 9 | 10 | 12 | 15 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/RunnerWindowControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | using Community.VisualStudio.Toolkit; 6 | using Microsoft.VisualStudio; 7 | using Microsoft.VisualStudio.Shell; 8 | using Task = System.Threading.Tasks.Task; 9 | 10 | namespace TestExtension 11 | { 12 | public partial class RunnerWindowControl : UserControl 13 | { 14 | public RunnerWindowControl(EnvDTE80.DTE2 dte) 15 | { 16 | InitializeComponent(); 17 | 18 | lblHeadline.Content = $"Visual Studio v{dte.Version}"; 19 | } 20 | 21 | private void button1_Click(object sender, RoutedEventArgs e) 22 | { 23 | ShowMessageAsync().FireAndForget(); 24 | } 25 | 26 | private async Task ShowMessageAsync() 27 | { 28 | await VS.Notifications.SetStatusbarTextAsync("Test"); 29 | var text = await VS.Notifications.GetStatusbarTextAsync(); 30 | await VS.Notifications.SetStatusbarTextAsync(text + " OK"); 31 | 32 | var ex = new Exception(nameof(TestExtension)); 33 | await ex.LogAsync(); 34 | 35 | VSConstants.MessageBoxResult button = VS.Notifications.ShowMessage("message", "title"); 36 | Debug.WriteLine(button); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/RunnerWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using System.Windows; 6 | using Community.VisualStudio.Toolkit; 7 | using EnvDTE80; 8 | using Microsoft.VisualStudio.Imaging; 9 | using Microsoft.VisualStudio.Shell; 10 | using Task = System.Threading.Tasks.Task; 11 | 12 | namespace TestExtension 13 | { 14 | public class RunnerWindow : BaseToolWindow 15 | { 16 | public override string GetTitle(int toolWindowId) => "Runner Window"; 17 | 18 | public override Type PaneType => typeof(Pane); 19 | 20 | public override async Task CreateAsync(int toolWindowId, CancellationToken cancellationToken) 21 | { 22 | // Simulate long running background task 23 | await Task.Delay(2000); 24 | 25 | await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); 26 | DTE2 dte = await VS.GetDTEAsync(); 27 | return new RunnerWindowControl(dte); 28 | } 29 | 30 | [Guid("d3b3ebd9-87d1-41cd-bf84-268d88953417")] 31 | public class Pane : ToolWindowPane 32 | { 33 | public Pane() 34 | { 35 | BitmapImageMoniker = KnownMonikers.StatusInformation; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/VSSDK.TestExtension/ToolWindows/RunnerWindowControl.xaml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 |