From 23317634f0718df861347063bccfc1ef10cdbda2 Mon Sep 17 00:00:00 2001 From: Matteo Prosperi <41970398+matteo-prosperi@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:40:13 -0700 Subject: [PATCH] Update samples for VS 17.11 (#374) Update samples for VS 17.11 --------- Co-authored-by: Matteo Prosperi Co-authored-by: Bertan Aygun Co-authored-by: Jasmine Woon Co-authored-by: Jasmine Woon --- .../CommandParentingSample.csproj | 4 +- .../CommentRemover/CommentRemover.csproj | 4 +- .../Samples/DialogSample/DialogSample.csproj | 4 +- .../DocumentSelectorSample.csproj | 4 +- .../ExtensionPublisher.csproj | 4 +- .../Processor/PathCapture.cs | 10 +-- .../FeatureGallery/FeatureGallery.csproj | 17 ++-- .../Samples/FeatureGallery/Image/ImageTest.cs | 35 ++++++++ .../Image/ModalDialogControl.cs | 24 ++++++ .../Image/ModalDialogControl.xaml | 29 +++++++ .../FeatureGallery/Image/ModalDialogData.cs | 33 ++++++++ .../Images/DefaultText.16.16.png | Bin 0 -> 406 bytes .../Samples/FeatureGallery/MainToolWindow.cs | 2 + .../FeatureGallery/Settings/SettingsTest.cs | 77 +++++++++++++++++ .../Images/DefaultText.16.16.png | Bin 0 -> 406 bytes .../InProcFeatureGallery.csproj | 11 +-- .../Samples/InsertGuid/InsertGuid.csproj | 4 +- .../MarkdownLinter/MarkdownLinter.csproj | 4 +- .../MemoryStreamVisualizer.csproj | 4 +- .../OutputWindowSample.csproj | 4 +- .../RegexMatchDebugVisualizer.csproj | 4 +- .../RustLanguageServerProvider.csproj | 4 +- .../SimpleRemoteCommandSample.csproj | 4 +- .../.vsextension/string-resources.json | 4 +- .../Images/DefaultText.16.16.png | Bin 0 -> 564 bytes .../Samples/ToolWindowSample/MyToolWindow.cs | 8 ++ .../ToolWindowSample/MyToolWindowControl.xaml | 45 ++++++---- .../ToolWindowSample/MyToolWindowData.cs | 32 +++++++ .../ToolWindowSample/MyToolbarCommand.cs | 29 +++++++ .../Samples/ToolWindowSample/README.md | 79 +++++++++++------- .../ToolWindowSample/ToolWindowSample.csproj | 4 +- .../UserPromptSample/UserPromptSample.csproj | 4 +- .../VSProjectQueryAPISample/AddFileCommand.cs | 4 +- .../AddSolutionConfigurationCommand.cs | 3 +- .../DeleteSolutionConfigurationCommand.cs | 3 +- .../ProjectBuildCommand.cs | 3 +- .../QueryFileCommand.cs | 4 +- .../QueryOutputGroupByIdCommand.cs | 4 +- .../QueryOutputGroupByNameCommand.cs | 4 +- .../QueryOutputGroupByProjectCommand.cs | 4 +- .../QuerySolutionConfigurations.cs | 4 +- .../Samples/VSProjectQueryAPISample/README.md | 32 +++---- .../ReloadProjectCommand.cs | 4 +- .../SetStartupProjectsCommand.cs | 4 +- .../VSProjectQueryAPISample/SkipOfNCommand.cs | 8 +- .../SolutionBuildCommand.cs | 3 +- .../SolutionSaveCommand.cs | 3 +- .../TrackProjectQueryCommand.cs | 4 +- .../UnloadProjectCommand.cs | 4 +- .../VSProjectQueryAPISample.csproj | 4 +- .../WordCountMarginSample.csproj | 4 +- 51 files changed, 467 insertions(+), 127 deletions(-) create mode 100644 New_Extensibility_Model/Samples/FeatureGallery/Image/ImageTest.cs create mode 100644 New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.cs create mode 100644 New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.xaml create mode 100644 New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogData.cs create mode 100644 New_Extensibility_Model/Samples/FeatureGallery/Images/DefaultText.16.16.png create mode 100644 New_Extensibility_Model/Samples/FeatureGallery/Settings/SettingsTest.cs create mode 100644 New_Extensibility_Model/Samples/InProcFeatureGallery/Images/DefaultText.16.16.png create mode 100644 New_Extensibility_Model/Samples/ToolWindowSample/Images/DefaultText.16.16.png create mode 100644 New_Extensibility_Model/Samples/ToolWindowSample/MyToolbarCommand.cs diff --git a/New_Extensibility_Model/Samples/CommandParentingSample/CommandParentingSample.csproj b/New_Extensibility_Model/Samples/CommandParentingSample/CommandParentingSample.csproj index a2ac24a..76abe4b 100644 --- a/New_Extensibility_Model/Samples/CommandParentingSample/CommandParentingSample.csproj +++ b/New_Extensibility_Model/Samples/CommandParentingSample/CommandParentingSample.csproj @@ -11,7 +11,7 @@ - - + + diff --git a/New_Extensibility_Model/Samples/CommentRemover/CommentRemover.csproj b/New_Extensibility_Model/Samples/CommentRemover/CommentRemover.csproj index 67b202a..871330b 100644 --- a/New_Extensibility_Model/Samples/CommentRemover/CommentRemover.csproj +++ b/New_Extensibility_Model/Samples/CommentRemover/CommentRemover.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/DialogSample/DialogSample.csproj b/New_Extensibility_Model/Samples/DialogSample/DialogSample.csproj index 6e72730..87d44d7 100644 --- a/New_Extensibility_Model/Samples/DialogSample/DialogSample.csproj +++ b/New_Extensibility_Model/Samples/DialogSample/DialogSample.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/DocumentSelectorSample/DocumentSelectorSample.csproj b/New_Extensibility_Model/Samples/DocumentSelectorSample/DocumentSelectorSample.csproj index 28f8d2a..ef4c794 100644 --- a/New_Extensibility_Model/Samples/DocumentSelectorSample/DocumentSelectorSample.csproj +++ b/New_Extensibility_Model/Samples/DocumentSelectorSample/DocumentSelectorSample.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/ExtensionPublisher/ExtensionPublisher.csproj b/New_Extensibility_Model/Samples/ExtensionPublisher/ExtensionPublisher.csproj index 8ca84ed..05376d2 100644 --- a/New_Extensibility_Model/Samples/ExtensionPublisher/ExtensionPublisher.csproj +++ b/New_Extensibility_Model/Samples/ExtensionPublisher/ExtensionPublisher.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/ExtensionPublisher/Processor/PathCapture.cs b/New_Extensibility_Model/Samples/ExtensionPublisher/Processor/PathCapture.cs index 115f4b8..35fe75b 100644 --- a/New_Extensibility_Model/Samples/ExtensionPublisher/Processor/PathCapture.cs +++ b/New_Extensibility_Model/Samples/ExtensionPublisher/Processor/PathCapture.cs @@ -32,10 +32,10 @@ public static class PathCapture q => q.With(p => p.Path), cancellationToken); - IProjectSnapshot result = queryResultsMainPath.FirstOrDefault() + string result = queryResultsMainPath.FirstOrDefault()?.Path ?? throw new ApplicationException("Project not found."); - return result.Path; + return result; } catch (Exception ex) { @@ -50,8 +50,8 @@ public static class PathCapture #pragma warning disable VSEXTPREVIEW_PROJECTQUERY_PROPERTIES_BUILDPROPERTIES // Type is for evaluation purposes only and is subject to change or removal in future updates. IQueryResults queryResults = await clientContext.Extensibility.Workspaces().QueryProjectsAsync( project => project.With(p => p.ActiveConfigurations - .With(config => config.BuildPropertiesByName( - PersistenceStorageType.ProjectFile, + .With(config => config.PropertiesByName( + PropertySourceType.ProjectFile, "TargetVsixContainer"))), cancellationToken); @@ -61,7 +61,7 @@ public static class PathCapture IProjectConfigurationSnapshot activeConfig = projectQueryResult.ActiveConfigurations.FirstOrDefault() ?? throw new InvalidOperationException("None active configurations."); - IBuildPropertySnapshot projectProperty = activeConfig.BuildProperties.FirstOrDefault() + IPropertySnapshot projectProperty = activeConfig.Properties.FirstOrDefault() ?? throw new InvalidOperationException("TargetVsixContainer not found."); return projectProperty.Value!; diff --git a/New_Extensibility_Model/Samples/FeatureGallery/FeatureGallery.csproj b/New_Extensibility_Model/Samples/FeatureGallery/FeatureGallery.csproj index 9b6b9eb..6679f3f 100644 --- a/New_Extensibility_Model/Samples/FeatureGallery/FeatureGallery.csproj +++ b/New_Extensibility_Model/Samples/FeatureGallery/FeatureGallery.csproj @@ -6,19 +6,22 @@ en-US - - + + + - - - + + + - - + + + + diff --git a/New_Extensibility_Model/Samples/FeatureGallery/Image/ImageTest.cs b/New_Extensibility_Model/Samples/FeatureGallery/Image/ImageTest.cs new file mode 100644 index 0000000..72a66f8 --- /dev/null +++ b/New_Extensibility_Model/Samples/FeatureGallery/Image/ImageTest.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if INPROC +namespace InProcFeatureGallery; +#else +namespace FeatureGallery; +#endif + +using System.Runtime.Serialization; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.Extensibility; + +[DataContract] +internal class ImageTest : TestData +{ + public ImageTest(VisualStudioExtensibility extensibility) + : base(extensibility) + { + } + + [DataMember] + public override string ButtonText => "Images"; + + [DataMember] + public override string Description => "This command opens a modal dialog showing 7 images in red borders."; + + protected override async Task RunAsync(IClientContext clientContext, CancellationToken cancellationToken) + { +#pragma warning disable CA2000 // Dispose objects before losing scope. ModalDialogControl is passed to Visual Studio which will take care of disposing it + await this.Extensibility.Shell().ShowDialogAsync(new Image.ModalDialogControl(), cancellationToken); +#pragma warning restore CA2000 // Dispose objects before losing scope + } +} diff --git a/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.cs b/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.cs new file mode 100644 index 0000000..2b984ff --- /dev/null +++ b/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if INPROC +namespace InProcFeatureGallery.Image; +#else +namespace FeatureGallery.Image; +#endif + +using Microsoft.VisualStudio.Extensibility.UI; + +/// +/// A sample remote user control to use as tool window UI content. +/// +internal class ModalDialogControl : RemoteUserControl +{ + /// + /// Initializes a new instance of the class. + /// + public ModalDialogControl() + : base(new ModalDialogData()) + { + } +} diff --git a/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.xaml b/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.xaml new file mode 100644 index 0000000..be25075 --- /dev/null +++ b/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogControl.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogData.cs b/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogData.cs new file mode 100644 index 0000000..13192a6 --- /dev/null +++ b/New_Extensibility_Model/Samples/FeatureGallery/Image/ModalDialogData.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if INPROC +namespace InProcFeatureGallery.Image; +#else +namespace FeatureGallery.Image; +#endif + +using System; +using System.Runtime.Serialization; +using System.Threading.Tasks; +using Microsoft.VisualStudio.Extensibility; +using Microsoft.VisualStudio.Extensibility.UI; + +[DataContract] +internal class ModalDialogData +{ + [DataMember] + public string StringImage { get; } = "DefaultText"; + + [DataMember] + public string StringImageFromCatalog { get; } = "KnownMonikers.ClearWindowContent"; + + [DataMember] + public ImageMoniker StringImageId { get; } = "ae27a6b0-e345-4288-96df-5eaf394ee369;1935"; + + [DataMember] + public ImageMoniker MonikerImage { get; } = ImageMoniker.Custom("KnownMonikers.ClearWindowContent"); + + [DataMember] + public ImageMoniker MonikerImageFromCatalog { get; } = ImageMoniker.KnownValues.Import; +} diff --git a/New_Extensibility_Model/Samples/FeatureGallery/Images/DefaultText.16.16.png b/New_Extensibility_Model/Samples/FeatureGallery/Images/DefaultText.16.16.png new file mode 100644 index 0000000000000000000000000000000000000000..342469872f93ac422f3e990811ee6b5c444f6e3a GIT binary patch literal 406 zcmV;H0crk;P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940V_#FK~y+T&CIr zuDg%oLYB)Ut>4=8-3=A+(2~|m=Z*Y*sCh{UUxM{D3c)Pc?*IS*07*qoM6N<$f{8z| Ap#T5? literal 0 HcmV?d00001 diff --git a/New_Extensibility_Model/Samples/FeatureGallery/MainToolWindow.cs b/New_Extensibility_Model/Samples/FeatureGallery/MainToolWindow.cs index 0b2f977..a277652 100644 --- a/New_Extensibility_Model/Samples/FeatureGallery/MainToolWindow.cs +++ b/New_Extensibility_Model/Samples/FeatureGallery/MainToolWindow.cs @@ -38,6 +38,8 @@ public class MainToolWindow : ToolWindow new ModalDialogTest(this.Extensibility), new EditorMarginTest(this.Extensibility), new LanguageServerTest(this.Extensibility), + new SettingsTest(this.Extensibility), + new ImageTest(this.Extensibility), }; } diff --git a/New_Extensibility_Model/Samples/FeatureGallery/Settings/SettingsTest.cs b/New_Extensibility_Model/Samples/FeatureGallery/Settings/SettingsTest.cs new file mode 100644 index 0000000..4b894b9 --- /dev/null +++ b/New_Extensibility_Model/Samples/FeatureGallery/Settings/SettingsTest.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if INPROC +namespace InProcFeatureGallery; +#else +namespace FeatureGallery; +#endif + +using System.Runtime.Serialization; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.Extensibility; +using Microsoft.VisualStudio.Extensibility.Settings; +using Microsoft.VisualStudio.Extensibility.Shell; + +[DataContract] +internal class SettingsTest : TestData +{ + public SettingsTest(VisualStudioExtensibility extensibility) + : base(extensibility) + { + } + + [DataMember] + public override string ButtonText => "Update a setting value"; + + [DataMember] + public override string Description => "This command updates a setting value and shows a prompt when the value update is complete."; + + [VisualStudioContribution] +#pragma warning disable VSEXTPREVIEW_SETTINGS // Type is for evaluation purposes only and is subject to change or removal in future updates. +#pragma warning disable CEE0027 // String not localized +#if INPROC + private static SettingCategory Category { get; } = new("inProcFeatureGallery", "In-Proc Feature Gallery"); +#else + private static SettingCategory Category { get; } = new("featureGallery", "Feature Gallery"); +#endif + + [VisualStudioContribution] + private static Setting.Boolean BooleanSetting { get; } = new("booleanSetting", "Boolean Setting", Category, defaultValue: false); +#pragma warning restore CEE0027 // String not localized + + protected override async Task RunAsync(IClientContext clientContext, CancellationToken cancellationToken) + { + await this.Extensibility.Settings().WriteAsync( + batch => batch.WriteSetting(BooleanSetting, false), + "Setting booleanSetting to false", + cancellationToken); + + await WaitForSettingValueAsync(expectedValue: false); + + await this.Extensibility.Settings().WriteAsync( + batch => batch.WriteSetting(BooleanSetting, true), + "Setting booleanSetting to true", + cancellationToken); + + await WaitForSettingValueAsync(expectedValue: true); + + async Task WaitForSettingValueAsync(bool expectedValue) + { + TaskCompletionSource settingValueIsFalse = new(); + using var settingValueObserver = await this.Extensibility.Settings().SubscribeAsync(BooleanSetting, cancellationToken, value => + { + if (value.Succeeded && value.Value == expectedValue) + { + settingValueIsFalse.SetResult(true); + } + }); + + await settingValueIsFalse.Task; + } + + await this.Extensibility.Shell().ShowPromptAsync("All done.", PromptOptions.OK, cancellationToken); + } +#pragma warning restore VSEXTPREVIEW_SETTINGS // Type is for evaluation purposes only and is subject to change or removal in future updates. +} diff --git a/New_Extensibility_Model/Samples/InProcFeatureGallery/Images/DefaultText.16.16.png b/New_Extensibility_Model/Samples/InProcFeatureGallery/Images/DefaultText.16.16.png new file mode 100644 index 0000000000000000000000000000000000000000..342469872f93ac422f3e990811ee6b5c444f6e3a GIT binary patch literal 406 zcmV;H0crk;P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940V_#FK~y+T&CIr zuDg%oLYB)Ut>4=8-3=A+(2~|m=Z*Y*sCh{UUxM{D3c)Pc?*IS*07*qoM6N<$f{8z| Ap#T5? literal 0 HcmV?d00001 diff --git a/New_Extensibility_Model/Samples/InProcFeatureGallery/InProcFeatureGallery.csproj b/New_Extensibility_Model/Samples/InProcFeatureGallery/InProcFeatureGallery.csproj index f04e769..bd57581 100644 --- a/New_Extensibility_Model/Samples/InProcFeatureGallery/InProcFeatureGallery.csproj +++ b/New_Extensibility_Model/Samples/InProcFeatureGallery/InProcFeatureGallery.csproj @@ -10,8 +10,8 @@ - - + + @@ -19,14 +19,15 @@ - - + + + - + diff --git a/New_Extensibility_Model/Samples/InsertGuid/InsertGuid.csproj b/New_Extensibility_Model/Samples/InsertGuid/InsertGuid.csproj index 8ef1ab1..5e1b5ca 100644 --- a/New_Extensibility_Model/Samples/InsertGuid/InsertGuid.csproj +++ b/New_Extensibility_Model/Samples/InsertGuid/InsertGuid.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/MarkdownLinter/MarkdownLinter.csproj b/New_Extensibility_Model/Samples/MarkdownLinter/MarkdownLinter.csproj index d031bb2..4e570f7 100644 --- a/New_Extensibility_Model/Samples/MarkdownLinter/MarkdownLinter.csproj +++ b/New_Extensibility_Model/Samples/MarkdownLinter/MarkdownLinter.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/MemoryStreamDebugVisualizer/MemoryStreamVisualizer/MemoryStreamVisualizer.csproj b/New_Extensibility_Model/Samples/MemoryStreamDebugVisualizer/MemoryStreamVisualizer/MemoryStreamVisualizer.csproj index d72f2ec..ebe31a6 100644 --- a/New_Extensibility_Model/Samples/MemoryStreamDebugVisualizer/MemoryStreamVisualizer/MemoryStreamVisualizer.csproj +++ b/New_Extensibility_Model/Samples/MemoryStreamDebugVisualizer/MemoryStreamVisualizer/MemoryStreamVisualizer.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/OutputWindowSample/OutputWindowSample.csproj b/New_Extensibility_Model/Samples/OutputWindowSample/OutputWindowSample.csproj index 70e74f7..5457c0c 100644 --- a/New_Extensibility_Model/Samples/OutputWindowSample/OutputWindowSample.csproj +++ b/New_Extensibility_Model/Samples/OutputWindowSample/OutputWindowSample.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer.csproj b/New_Extensibility_Model/Samples/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer.csproj index 6bd5ae9..5d48f24 100644 --- a/New_Extensibility_Model/Samples/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer.csproj +++ b/New_Extensibility_Model/Samples/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer/RegexMatchDebugVisualizer.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/RustLanguageServerProvider/RustLanguageServerProvider.csproj b/New_Extensibility_Model/Samples/RustLanguageServerProvider/RustLanguageServerProvider.csproj index b3521aa..0120adf 100644 --- a/New_Extensibility_Model/Samples/RustLanguageServerProvider/RustLanguageServerProvider.csproj +++ b/New_Extensibility_Model/Samples/RustLanguageServerProvider/RustLanguageServerProvider.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/New_Extensibility_Model/Samples/SimpleRemoteCommandSample/SimpleRemoteCommandSample.csproj b/New_Extensibility_Model/Samples/SimpleRemoteCommandSample/SimpleRemoteCommandSample.csproj index af20a5b..95f07f0 100644 --- a/New_Extensibility_Model/Samples/SimpleRemoteCommandSample/SimpleRemoteCommandSample.csproj +++ b/New_Extensibility_Model/Samples/SimpleRemoteCommandSample/SimpleRemoteCommandSample.csproj @@ -7,7 +7,7 @@ - - + + diff --git a/New_Extensibility_Model/Samples/ToolWindowSample/.vsextension/string-resources.json b/New_Extensibility_Model/Samples/ToolWindowSample/.vsextension/string-resources.json index fc36811..e451115 100644 --- a/New_Extensibility_Model/Samples/ToolWindowSample/.vsextension/string-resources.json +++ b/New_Extensibility_Model/Samples/ToolWindowSample/.vsextension/string-resources.json @@ -1,3 +1,5 @@ { - "ToolWindowSample.MyToolWindowCommand.DisplayName": "My Tool Window" + "ToolWindowSample.MyToolWindowCommand.DisplayName": "My Tool Window", + "ToolWindowSample.MyToolbarCommand.DisplayName": "Toolbar command", + "ToolWindowSample.MyToolWindow.Toolbar.DisplayName": "My Toolbar" } \ No newline at end of file diff --git a/New_Extensibility_Model/Samples/ToolWindowSample/Images/DefaultText.16.16.png b/New_Extensibility_Model/Samples/ToolWindowSample/Images/DefaultText.16.16.png new file mode 100644 index 0000000000000000000000000000000000000000..fbbecb1be0407dc0a19e3e1951127554fb4f7a4a GIT binary patch literal 564 zcmV-40?Yl0P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940m(^3K~y+Tb<}MIQt^Z5r~duEbyt9N zwpS>{6pnF%19#p(XTMrE0&w^NTLT7BflXZCH$G!7z8`b$@}T>FtZWS75FR|kFKpo_ zmhc*n5c|0G#ui^sVyj0B(qKf>-M|QDQHUP2;~}m~AV3bA4_omUrtR0)F%A3h5?%O? zxA+(ikjYjHGdY6IEQ3v4hGjfKKbr6kqv84k*hI@R)nR;tCG^3%Q_zhaj3f7|2P^{^ zNyT^yGbl$h^5INu;}5csl0fS6VI!)M2 new() { Placement = ToolWindowPlacement.DocumentWell, + Toolbar = new ToolWindowToolbar(Toolbar), + }; + + [VisualStudioContribution] + private static ToolbarConfiguration Toolbar => new("%ToolWindowSample.MyToolWindow.Toolbar.DisplayName%") + { + Children = [ToolbarChild.Command()], }; /// diff --git a/New_Extensibility_Model/Samples/ToolWindowSample/MyToolWindowControl.xaml b/New_Extensibility_Model/Samples/ToolWindowSample/MyToolWindowControl.xaml index 5b5c221..79dd014 100644 --- a/New_Extensibility_Model/Samples/ToolWindowSample/MyToolWindowControl.xaml +++ b/New_Extensibility_Model/Samples/ToolWindowSample/MyToolWindowControl.xaml @@ -12,21 +12,36 @@ - -