Skip to content

Commit

Permalink
working next version
Browse files Browse the repository at this point in the history
  • Loading branch information
mmanela committed Apr 29, 2020
1 parent 4d50d52 commit adce6e8
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 171 deletions.
6 changes: 2 additions & 4 deletions src/SnippetDesigner/Guids.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.VisualStudio;
using System;

namespace Microsoft.SnippetDesigner
{
Expand All @@ -22,9 +23,6 @@ public static class GuidList

internal const string markerServiceString = "BD9FE285-9066-4553-9C6A-C2F49A24777E";

internal const string autoLoadOnSolutionExists = "f1536ef8-92ec-443c-9ed7-fdadf150da82";
internal const string autoLoadOnNoSolution = "adfc4e64-0397-11d1-9f4e-00a0c911004f";

internal const string editorFactoryLogicalView = "{7651a703-06e5-11d1-8ebd-00a0c90f26ea}";

internal const string miscellaneousFilesProject = "{A2FE74E1-B743-11d0-AE1A-00A0C90FFFC3}";
Expand Down
2 changes: 1 addition & 1 deletion src/SnippetDesigner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.6.*")]
[assembly: AssemblyVersion("1.8.*")]
15 changes: 12 additions & 3 deletions src/SnippetDesigner/SnippetDesigner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<Import Project="..\..\..\..\CxCache\Microsoft.VSSDK.BuildTools.16.4.17\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\..\..\CxCache\Microsoft.VSSDK.BuildTools.16.4.17\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<OldToolsVersion>14.0</OldToolsVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<OldToolsVersion>15.0</OldToolsVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
Expand Down Expand Up @@ -43,6 +46,9 @@
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -72,6 +78,9 @@
<HintPath>..\..\..\..\CxCache\VSSDK.CoreUtility.12.0.4\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.DpiAwareness, Version=6.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\..\CxCache\Microsoft.VisualStudio.DpiAwareness.6.5.29903\lib\net46\Microsoft.VisualStudio.DpiAwareness.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.Editor, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\..\CxCache\VSSDK.Editor.12.0.4\lib\net45\Microsoft.VisualStudio.Editor.dll</HintPath>
<Private>True</Private>
Expand Down
Binary file modified src/SnippetDesigner/SnippetDesigner.pkgdef
Binary file not shown.
14 changes: 9 additions & 5 deletions src/SnippetDesigner/SnippetDesignerPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ namespace Microsoft.SnippetDesigner
// This attribute tells the registration utility (regpkg.exe) that this class needs
// to be registered as package.
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#100", "#102", "1.6.5", IconResourceID = 404)]
[InstalledProductRegistration("#100", "#102", "1.8.1", IconResourceID = 404)]
[ProvideMenuResource("Menus.ctmenu", 1)]
// This attribute registers a tool window exposed by this package.
[ProvideToolWindow(typeof(SnippetExplorerToolWindow))]
// Options pages
[ProvideOptionPage(typeof(SnippetDesignerOptions), "Snippet Designer", "General Options", 14340, 17770, true)]
[ProvideOptionPage(typeof(ResetOptions), "Snippet Designer", "Reset", 14340, 17771, true)]
[ProvideAutoLoad(GuidList.autoLoadOnNoSolution, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideAutoLoad(GuidList.autoLoadOnSolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideEditorExtension(typeof(EditorFactory), StringConstants.SnippetExtension, 70,
ProjectGuid = GuidList.miscellaneousFilesProject,
DefaultName = "Snippet Designer",
Expand Down Expand Up @@ -148,7 +148,12 @@ public bool IsVisualStudio2013

public bool IsVisualStudio2017
{
get { return VSVersion.Equals("15.0"); }
get { return VSVersion.StartsWith("15."); }
}

public bool IsVisualStudio2019
{
get { return VSVersion.StartsWith("16."); }
}

/// <summary>
Expand Down Expand Up @@ -249,7 +254,6 @@ private void ShowSnippetExplorer(object sender, EventArgs e)
{
throw new COMException(Resources.CanNotCreateWindow);
}
Guid textEditor = GuidList.textEditorFactory;
var windowFrame = (IVsWindowFrame)window.Frame;
ErrorHandler.ThrowOnFailure(windowFrame.Show());
}
Expand Down
5 changes: 5 additions & 0 deletions src/SnippetDesigner/SnippetDirectories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ private void AddPathsFromRegistryKey(RegistryKey key, string subKeyName)
{
using (RegistryKey subKey = key.OpenSubKey(subKeyName))
{
if (subKey == null)
{
return;
}

foreach (string name in subKey.GetValueNames())
{
string possiblePathString = subKey.GetValue(name) as string;
Expand Down
40 changes: 15 additions & 25 deletions src/SnippetDesigner/SnippetEditor/SnippetEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,41 +143,31 @@ public SnippetEditor(SnippetDesignerPackage package)
public void SetPropertyGridColors()
{
ThreadHelper.ThrowIfNotOnUIThread();
IVsUIShell5 shell = (IVsUIShell5)GetVsService(typeof(SVsUIShell));
var backgroundColor2 = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SystemBackgroundColorKey);
var backgroundColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ToolWindowBackgroundColorKey);
IVsUIShell5 shell = (IVsUIShell5)GetVsService(typeof(SVsUIShell));
var searchBoxBackgroundColorKey = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SearchBoxBackgroundColorKey);
var backgroundColorLighter = VsColors.GetThemedGDIColor(shell, EnvironmentColors.BrandedUIBackgroundColorKey);
var backgroundColorDarker = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ToolWindowBackgroundColorKey);
var foregroundColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ToolWindowTextColorKey);
var lineColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ToolWindowContentGridColorKey);
var disabledColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SystemGrayTextColorKey);
var highlightColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SystemHighlightColorKey);
var highlightTextColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SystemHighlightTextColorKey);
var hyperLinkColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ControlLinkTextColorKey);
var hyperLinkActiveColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ControlLinkTextPressedColorKey);
var buttonFaceColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SystemButtonFaceBrushKey);
var buttonTextColor = VsColors.GetThemedGDIColor(shell, EnvironmentColors.SystemButtonTextColorKey);
var toolWindowContentGridColorKey = VsColors.GetThemedGDIColor(shell, EnvironmentColors.ToolWindowContentGridColorKey);
var gridHeadingBackgroundColorKey = VsColors.GetThemedGDIColor(shell, EnvironmentColors.GridHeadingBackgroundColorKey);
var gridHeadingTextColorKey = VsColors.GetThemedGDIColor(shell, EnvironmentColors.GridHeadingTextColorKey);

this.codeReplacementsSplitter.BackColor = backgroundColor;
this.languageLabel.BackColor = backgroundColor;

this.codeReplacementsSplitter.BackColor = backgroundColorDarker;
this.languageLabel.BackColor = backgroundColorLighter;
this.languageLabel.ForeColor = foregroundColor;
this.replacementLabel.BackColor = backgroundColor;
this.replacementLabel.BackColor = backgroundColorLighter;
this.replacementLabel.ForeColor = foregroundColor;
this.replacementTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.None;
this.shortcutLabel.BackColor = backgroundColor;
this.shortcutLabel.BackColor = backgroundColorLighter;
this.shortcutLabel.ForeColor = foregroundColor;
this.shortcutTextBox.BackColor = backgroundColor;
this.shortcutTextBox.BackColor = searchBoxBackgroundColorKey;
this.shortcutTextBox.ForeColor = foregroundColor;
this.snippetCodeWindow.BackColor = backgroundColor;
this.snippetCodeWindow.BackColor = backgroundColorDarker;
this.snippetCodeWindow.ForeColor = foregroundColor;
this.snippetsLabel.BackColor = backgroundColor;
this.snippetsLabel.BackColor = backgroundColorLighter;
this.snippetsLabel.ForeColor = foregroundColor;
this.toolStripLanguageBox.BackColor = backgroundColor;
this.toolStripLanguageBox.BackColor = searchBoxBackgroundColorKey;
this.toolStripLanguageBox.ForeColor = foregroundColor;
this.toolStripSnippetTitles.BackColor = backgroundColor;
this.toolStripSnippetTitles.BackColor = searchBoxBackgroundColorKey;
this.toolStripSnippetTitles.ForeColor = foregroundColor;
this.topCommandBar.BackColor = backgroundColor;
this.topCommandBar.BackColor = backgroundColorLighter;
this.topCommandBar.ForeColor = foregroundColor;
}

Expand Down
22 changes: 11 additions & 11 deletions src/SnippetDesigner/SnippetEditor/SnippetEditorForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit adce6e8

Please sign in to comment.