Skip to content

Commit d55b6cd

Browse files
committed
Added Visual Studio 2022 version
Issue NoahRic#15
1 parent ad785a8 commit d55b6cd

9 files changed

+255
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.ComponentModel.Composition;
2+
using Microsoft.VisualStudio.Text.Editor;
3+
using Microsoft.VisualStudio.Utilities;
4+
5+
namespace DisableMouseWheelZoomVS2022
6+
{
7+
[Export(typeof(IWpfTextViewCreationListener))]
8+
[ContentType("text")]
9+
[TextViewRole(PredefinedTextViewRoles.Zoomable)]
10+
internal class ViewCreationListener : IWpfTextViewCreationListener
11+
{
12+
public void TextViewCreated(IWpfTextView textView)
13+
{
14+
textView.Options.SetOptionValue(DefaultWpfViewOptions.EnableMouseWheelZoomId, false);
15+
}
16+
}
17+
}
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
8+
<PropertyGroup>
9+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
11+
<SchemaVersion>2.0</SchemaVersion>
12+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
13+
<ProjectGuid>{F97E22BB-B908-429C-ACB3-36119C1F5078}</ProjectGuid>
14+
<OutputType>Library</OutputType>
15+
<AppDesignerFolder>Properties</AppDesignerFolder>
16+
<RootNamespace>DisableMouseWheelZoomVS2022</RootNamespace>
17+
<AssemblyName>DisableMouseWheelZoomVS2022</AssemblyName>
18+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
19+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
20+
<UseCodebase>true</UseCodebase>
21+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
22+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
23+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
24+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
25+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
26+
<StartAction>Program</StartAction>
27+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
28+
<StartArguments>/rootsuffix Exp</StartArguments>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
31+
<DebugSymbols>true</DebugSymbols>
32+
<DebugType>full</DebugType>
33+
<Optimize>false</Optimize>
34+
<OutputPath>bin\Debug\</OutputPath>
35+
<DefineConstants>DEBUG;TRACE</DefineConstants>
36+
<ErrorReport>prompt</ErrorReport>
37+
<WarningLevel>4</WarningLevel>
38+
</PropertyGroup>
39+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
40+
<DebugType>pdbonly</DebugType>
41+
<Optimize>true</Optimize>
42+
<OutputPath>bin\Release\</OutputPath>
43+
<DefineConstants>TRACE</DefineConstants>
44+
<ErrorReport>prompt</ErrorReport>
45+
<WarningLevel>4</WarningLevel>
46+
</PropertyGroup>
47+
<ItemGroup>
48+
<Compile Include="DisableMouseWheelZoomFactory.cs" />
49+
<Compile Include="DisableMouseWheelZoomVS2022Package.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<None Include="source.extension.vsixmanifest">
54+
<SubType>Designer</SubType>
55+
</None>
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Reference Include="System" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.32112.339" ExcludeAssets="runtime">
62+
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
63+
</PackageReference>
64+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.0.5234" />
65+
<PackageReference Include="System.ComponentModel.Composition">
66+
<Version>6.0.0</Version>
67+
</PackageReference>
68+
</ItemGroup>
69+
<ItemGroup>
70+
<Content Include="ms-pl.txt">
71+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
72+
<IncludeInVSIX>true</IncludeInVSIX>
73+
</Content>
74+
</ItemGroup>
75+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
76+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
77+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
78+
Other similar extension points exist, see Microsoft.Common.targets.
79+
<Target Name="BeforeBuild">
80+
</Target>
81+
<Target Name="AfterBuild">
82+
</Target>
83+
-->
84+
</Project>
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32112.339
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisableMouseWheelZoomVS2022", "DisableMouseWheelZoomVS2022.csproj", "{F97E22BB-B908-429C-ACB3-36119C1F5078}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Debug|x86 = Debug|x86
12+
Release|Any CPU = Release|Any CPU
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Debug|x86.ActiveCfg = Debug|x86
19+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Debug|x86.Build.0 = Debug|x86
20+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Release|x86.ActiveCfg = Release|x86
23+
{F97E22BB-B908-429C-ACB3-36119C1F5078}.Release|x86.Build.0 = Release|x86
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {D9516C50-A235-48CB-A136-417743666751}
30+
EndGlobalSection
31+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VS/@EntryIndexedValue">VS</s:String></wpf:ResourceDictionary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Runtime.InteropServices;
2+
using Microsoft.VisualStudio.Shell;
3+
4+
namespace DisableMouseWheelZoomVS2022
5+
{
6+
/// <summary>
7+
/// This is the class that implements the package exposed by this assembly.
8+
/// </summary>
9+
/// <remarks>
10+
/// <para>
11+
/// The minimum requirement for a class to be considered a valid package for Visual Studio
12+
/// is to implement the IVsPackage interface and register itself with the shell.
13+
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
14+
/// to do it: it derives from the Package class that provides the implementation of the
15+
/// IVsPackage interface and uses the registration attributes defined in the framework to
16+
/// register itself and its components with the shell. These attributes tell the pkgdef creation
17+
/// utility what data to put into .pkgdef file.
18+
/// </para>
19+
/// <para>
20+
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
21+
/// </para>
22+
/// </remarks>
23+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
24+
[Guid(PackageGuidString)]
25+
public sealed class DisableMouseWheelZoomVS2022Package : AsyncPackage
26+
{
27+
/// <summary>
28+
/// DisableMouseWheelZoomVS2022Package GUID string.
29+
/// </summary>
30+
public const string PackageGuidString = "66157039-026c-4624-aba2-d4a2dc0208c1";
31+
}
32+
}

VS2022/Properties/AssemblyInfo.cs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("DisableMouseWheelZoomVS2022")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("DisableMouseWheelZoomVS2022")]
13+
[assembly: AssemblyCopyright("")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// Version information for an assembly consists of the following four values:
23+
//
24+
// Major Version
25+
// Minor Version
26+
// Build Number
27+
// Revision
28+
//
29+
// You can specify all the values or you can default the Build and Revision Numbers
30+
// by using the '*' as shown below:
31+
// [assembly: AssemblyVersion("1.0.*")]
32+
[assembly: AssemblyVersion("1.0.0.0")]
33+
[assembly: AssemblyFileVersion("1.0.0.0")]

VS2022/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
I could not find a way to upgrade the project easily. It's very likely my lack of experience with VS extensions, but I'm not sure if it's possible to be compatible with earlier versions at the same time. Either way, I simply created a new project and copied the relevant code over, so this one is just for VS2022.

VS2022/ms-pl.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Microsoft Public License (Ms-PL)
2+
3+
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
4+
5+
1. Definitions
6+
7+
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
8+
9+
A "contribution" is the original software, or any additions or changes to the software.
10+
11+
A "contributor" is any person that distributes its contribution under this license.
12+
13+
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
14+
15+
2. Grant of Rights
16+
17+
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
18+
19+
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
20+
21+
3. Conditions and Limitations
22+
23+
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
24+
25+
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
26+
27+
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
28+
29+
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
30+
31+
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

VS2022/source.extension.vsixmanifest

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
3+
<Metadata>
4+
<Identity Id="DisableMouseWheelZoomVS2022.b7eeadd1-22b3-4f85-aa03-d3773c0553f6" Version="20.22" Language="en-US" Publisher="Noah Richards" />
5+
<DisplayName>Disable Mouse Wheel Zoom (VS2022)</DisplayName>
6+
<Description xml:space="preserve">Disables zooming with the ctrl+mouse wheel gesture.</Description>
7+
<License>ms-pl.txt</License>
8+
</Metadata>
9+
<Installation>
10+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
11+
<ProductArchitecture>amd64</ProductArchitecture>
12+
</InstallationTarget>
13+
</Installation>
14+
<Dependencies>
15+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
16+
</Dependencies>
17+
<Prerequisites>
18+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
19+
</Prerequisites>
20+
<Assets>
21+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
22+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
23+
</Assets>
24+
</PackageManifest>

0 commit comments

Comments
 (0)