Skip to content

Commit 372cca8

Browse files
committed
Copy base code from LangSvcV2 project
1 parent d894b69 commit 372cca8

File tree

8 files changed

+331
-0
lines changed

8 files changed

+331
-0
lines changed

MouseFastScroll.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,19 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
99
README.md = README.md
1010
EndProjectSection
1111
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tvl.VisualStudio.MouseFastScroll", "Tvl.VisualStudio.MouseFastScroll\Tvl.VisualStudio.MouseFastScroll.csproj", "{7DFA0DD1-8052-464D-9A1A-5EADC10A84B0}"
13+
EndProject
1214
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Release|Any CPU = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{7DFA0DD1-8052-464D-9A1A-5EADC10A84B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{7DFA0DD1-8052-464D-9A1A-5EADC10A84B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{7DFA0DD1-8052-464D-9A1A-5EADC10A84B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{7DFA0DD1-8052-464D-9A1A-5EADC10A84B0}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
1325
GlobalSection(SolutionProperties) = preSolution
1426
HideSolutionNode = FALSE
1527
EndGlobalSection
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
namespace Tvl.VisualStudio.MouseFastScroll
2+
{
3+
using ITextView = Microsoft.VisualStudio.Text.Editor.ITextView;
4+
using Keyboard = System.Windows.Input.Keyboard;
5+
using ModifierKeys = System.Windows.Input.ModifierKeys;
6+
using MouseProcessorBase = Microsoft.VisualStudio.Text.Editor.MouseProcessorBase;
7+
using MouseWheelEventArgs = System.Windows.Input.MouseWheelEventArgs;
8+
using ScrollDirection = Microsoft.VisualStudio.Text.Editor.ScrollDirection;
9+
10+
internal class FastScrollProcessor : MouseProcessorBase
11+
{
12+
public FastScrollProcessor(ITextView textView)
13+
{
14+
TextView = textView;
15+
}
16+
17+
private ITextView TextView
18+
{
19+
get;
20+
set;
21+
}
22+
23+
public override void PreprocessMouseWheel(MouseWheelEventArgs e)
24+
{
25+
var scroller = TextView.ViewScroller;
26+
if (scroller != null && Keyboard.Modifiers == ModifierKeys.Control)
27+
{
28+
scroller.ScrollViewportVerticallyByPage(e.Delta < 0 ? ScrollDirection.Down : ScrollDirection.Up);
29+
e.Handled = true;
30+
}
31+
}
32+
}
33+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace Tvl.VisualStudio.MouseFastScroll
2+
{
3+
using System.ComponentModel.Composition;
4+
using Microsoft.VisualStudio.Text.Editor;
5+
using Microsoft.VisualStudio.Utilities;
6+
7+
[Export(typeof(IMouseProcessorProvider))]
8+
[Order]
9+
[ContentType("text")]
10+
[Name("FastScroll")]
11+
[TextViewRole(PredefinedTextViewRoles.Interactive)]
12+
public class FastScrollProvider : IMouseProcessorProvider
13+
{
14+
public IMouseProcessor GetAssociatedProcessor(IWpfTextView wpfTextView)
15+
{
16+
if (wpfTextView == null)
17+
return null;
18+
19+
wpfTextView.Options.SetOptionValue(DefaultWpfViewOptions.EnableMouseWheelZoomId, false);
20+
return new FastScrollProcessor(wpfTextView);
21+
}
22+
}
23+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
// General Information about an assembly is controlled through the following
5+
// set of attributes. Change these attribute values to modify the information
6+
// associated with an assembly.
7+
[assembly: AssemblyTitle("Tvl.VisualStudio.MouseFastScroll")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("Tunnel Vision Laboratories, LLC")]
11+
[assembly: AssemblyProduct("Tvl.VisualStudio.MouseFastScroll")]
12+
[assembly: AssemblyCopyright("Copyright © Sam Harwell 2013")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// Setting ComVisible to false makes the types in this assembly not visible
17+
// to COM components. If you need to access a type in this assembly from
18+
// COM, set the ComVisible attribute to true on that type.
19+
[assembly: ComVisible(false)]
20+
21+
// Version information for an assembly consists of the following four values:
22+
//
23+
// Major Version
24+
// Minor Version
25+
// Build Number
26+
// Revision
27+
//
28+
// You can specify all the values or you can default the Build and Revision Numbers
29+
// by using the '*' as shown below:
30+
// [assembly: AssemblyVersion("1.0.*")]
31+
[assembly: AssemblyVersion("2.0.0.0")]
32+
[assembly: AssemblyFileVersion("2.0.0.0")]
33+
[assembly: AssemblyInformationalVersion("2.0.0.0")]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<stylecopresultscache>
2+
<version>12</version>
3+
<project key="-1763659374">
4+
<configuration>DEBUG;TRACE</configuration>
5+
</project>
6+
</stylecopresultscache>
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProductVersion>8.0.30703</ProductVersion>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
10+
<ProjectGuid>{7DFA0DD1-8052-464D-9A1A-5EADC10A84B0}</ProjectGuid>
11+
<OutputType>Library</OutputType>
12+
<AppDesignerFolder>Properties</AppDesignerFolder>
13+
<RootNamespace>Tvl.VisualStudio.MouseFastScroll</RootNamespace>
14+
<AssemblyName>Tvl.VisualStudio.MouseFastScroll</AssemblyName>
15+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
16+
<FileAlignment>512</FileAlignment>
17+
<GeneratePkgDefFile>false</GeneratePkgDefFile>
18+
<UseCodebase>true</UseCodebase>
19+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
20+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
21+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
22+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
23+
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
24+
<CodeContractsAssemblyMode>1</CodeContractsAssemblyMode>
25+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
26+
<RestorePackages>true</RestorePackages>
27+
</PropertyGroup>
28+
<PropertyGroup>
29+
<!-- Common debugging support -->
30+
<StartAction>Program</StartAction>
31+
<StartProgram>$(DevEnvDir)\devenv.exe</StartProgram>
32+
<StartArguments>/rootSuffix Exp</StartArguments>
33+
</PropertyGroup>
34+
<PropertyGroup>
35+
<!-- Use the SDK for the current version of Visual Studio -->
36+
<VsSdkTargets Condition="'$(VisualStudioVersion)'!=''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\VSSDK\Microsoft.VsSDK.targets</VsSdkTargets>
37+
<VsSdkTargets Condition="'$(VisualStudioVersion)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets</VsSdkTargets>
38+
</PropertyGroup>
39+
<PropertyGroup Condition="'$(VisualStudioVersion)' != ''">
40+
<!-- This is added to prevent forced migrations in Visual Studio 2012 and newer -->
41+
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
42+
</PropertyGroup>
43+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
44+
<DebugSymbols>true</DebugSymbols>
45+
<DebugType>full</DebugType>
46+
<Optimize>false</Optimize>
47+
<OutputPath>bin\Debug\</OutputPath>
48+
<DefineConstants>DEBUG;TRACE</DefineConstants>
49+
<ErrorReport>prompt</ErrorReport>
50+
<WarningLevel>4</WarningLevel>
51+
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
52+
<CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
53+
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
54+
<CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
55+
<CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
56+
<CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
57+
<CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
58+
<CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
59+
<CodeContractsContainerAnalysis>False</CodeContractsContainerAnalysis>
60+
<CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
61+
<CodeContractsRunInBackground>True</CodeContractsRunInBackground>
62+
<CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
63+
<CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
64+
<CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
65+
<CodeContractsCustomRewriterAssembly />
66+
<CodeContractsCustomRewriterClass />
67+
<CodeContractsLibPaths />
68+
<CodeContractsExtraRewriteOptions />
69+
<CodeContractsExtraAnalysisOptions />
70+
<CodeContractsBaseLineFile />
71+
<CodeContractsRuntimeCheckingLevel>ReleaseRequires</CodeContractsRuntimeCheckingLevel>
72+
<CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
73+
<CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers>
74+
<CodeContractsEnumObligations>False</CodeContractsEnumObligations>
75+
<CodeContractsCacheAnalysisResults>False</CodeContractsCacheAnalysisResults>
76+
<CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel>
77+
</PropertyGroup>
78+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
79+
<DebugType>pdbonly</DebugType>
80+
<Optimize>true</Optimize>
81+
<OutputPath>bin\Release\</OutputPath>
82+
<DefineConstants>TRACE</DefineConstants>
83+
<ErrorReport>prompt</ErrorReport>
84+
<WarningLevel>4</WarningLevel>
85+
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
86+
<CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
87+
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
88+
<CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
89+
<CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
90+
<CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
91+
<CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
92+
<CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
93+
<CodeContractsContainerAnalysis>False</CodeContractsContainerAnalysis>
94+
<CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
95+
<CodeContractsRunInBackground>True</CodeContractsRunInBackground>
96+
<CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
97+
<CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
98+
<CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
99+
<CodeContractsCustomRewriterAssembly />
100+
<CodeContractsCustomRewriterClass />
101+
<CodeContractsLibPaths />
102+
<CodeContractsExtraRewriteOptions />
103+
<CodeContractsExtraAnalysisOptions />
104+
<CodeContractsBaseLineFile />
105+
<CodeContractsRuntimeCheckingLevel>ReleaseRequires</CodeContractsRuntimeCheckingLevel>
106+
<CodeContractsReferenceAssembly>DoNotBuild</CodeContractsReferenceAssembly>
107+
</PropertyGroup>
108+
<ItemGroup>
109+
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
110+
<Private>False</Private>
111+
<HintPath>..\packages\VSSDK.CoreUtility.10.10.0.2\lib\net40\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
112+
</Reference>
113+
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
114+
<Private>False</Private>
115+
<HintPath>..\packages\VSSDK.Text.10.10.0.2\lib\net40\Microsoft.VisualStudio.Text.Data.dll</HintPath>
116+
</Reference>
117+
<Reference Include="Microsoft.VisualStudio.Text.Logic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
118+
<Private>False</Private>
119+
<HintPath>..\packages\VSSDK.Text.10.10.0.2\lib\net40\Microsoft.VisualStudio.Text.Logic.dll</HintPath>
120+
</Reference>
121+
<Reference Include="Microsoft.VisualStudio.Text.UI, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
122+
<Private>False</Private>
123+
<HintPath>..\packages\VSSDK.Text.10.10.0.2\lib\net40\Microsoft.VisualStudio.Text.UI.dll</HintPath>
124+
</Reference>
125+
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
126+
<Private>False</Private>
127+
<HintPath>..\packages\VSSDK.Text.10.10.0.2\lib\net40\Microsoft.VisualStudio.Text.UI.Wpf.dll</HintPath>
128+
</Reference>
129+
<Reference Include="PresentationCore" />
130+
<Reference Include="PresentationFramework" />
131+
<Reference Include="System" />
132+
<Reference Include="System.ComponentModel.Composition" />
133+
<Reference Include="System.Core" />
134+
<Reference Include="System.Xml.Linq" />
135+
<Reference Include="System.Data.DataSetExtensions" />
136+
<Reference Include="Microsoft.CSharp" />
137+
<Reference Include="System.Data" />
138+
<Reference Include="System.Xml" />
139+
<Reference Include="WindowsBase" />
140+
</ItemGroup>
141+
<ItemGroup>
142+
<Compile Include="FastScrollProcessor.cs" />
143+
<Compile Include="FastScrollProvider.cs" />
144+
<Compile Include="Properties\AssemblyInfo.cs" />
145+
</ItemGroup>
146+
<ItemGroup>
147+
<None Include="packages.config" />
148+
<None Include="source.extension.vsixmanifest">
149+
<SubType>Designer</SubType>
150+
</None>
151+
</ItemGroup>
152+
<ItemGroup>
153+
<Content Include="..\External\Eula.rtf">
154+
<Link>Eula.rtf</Link>
155+
<IncludeInVSIX>true</IncludeInVSIX>
156+
</Content>
157+
<None Include="..\External\Key.snk">
158+
<Link>Key.snk</Link>
159+
</None>
160+
</ItemGroup>
161+
<PropertyGroup>
162+
<SignAssembly>true</SignAssembly>
163+
</PropertyGroup>
164+
<PropertyGroup>
165+
<AssemblyOriginatorKeyFile>..\External\Key.snk</AssemblyOriginatorKeyFile>
166+
</PropertyGroup>
167+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
168+
<Import Condition="Exists($(VsSdkTargets))" Project="$(VsSdkTargets)" />
169+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
170+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
171+
<PropertyGroup>
172+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
173+
</PropertyGroup>
174+
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
175+
</Target>
176+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
177+
Other similar extension points exist, see Microsoft.Common.targets.
178+
<Target Name="BeforeBuild">
179+
</Target>
180+
<Target Name="AfterBuild">
181+
</Target>
182+
-->
183+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="VSSDK.CoreUtility.10" version="10.0.2" targetFramework="net40" />
4+
<package id="VSSDK.IDE.10" version="10.0.2" targetFramework="net40" />
5+
<package id="VSSDK.Text.10" version="10.0.2" targetFramework="net40" />
6+
</packages>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
3+
<Identifier Id="Tvl.VisualStudio.MouseFastScroll.7DFA0DD1-8052-464D-9A1A-5EADC10A84B0">
4+
<Name>Mouse Fast Scroll</Name>
5+
<Author>Sam Harwell</Author>
6+
<Version>2.0.0</Version>
7+
<Description xml:space="preserve">Use Ctrl+Mouse Wheel for fast and easy Page Up/Down scrolling.</Description>
8+
<Locale>1033</Locale>
9+
<License>Eula.rtf</License>
10+
<SupportedProducts>
11+
<VisualStudio Version="10.0">
12+
<Edition>Ultimate</Edition>
13+
<Edition>Premium</Edition>
14+
<Edition>Pro</Edition>
15+
<Edition>IntegratedShell</Edition>
16+
</VisualStudio>
17+
<VisualStudio Version="11.0">
18+
<Edition>Ultimate</Edition>
19+
<Edition>Premium</Edition>
20+
<Edition>Pro</Edition>
21+
<Edition>IntegratedShell</Edition>
22+
</VisualStudio>
23+
<VisualStudio Version="12.0">
24+
<Edition>Ultimate</Edition>
25+
<Edition>Premium</Edition>
26+
<Edition>Pro</Edition>
27+
<Edition>IntegratedShell</Edition>
28+
</VisualStudio>
29+
</SupportedProducts>
30+
<SupportedFrameworkRuntimeEdition MinVersion="4.0" />
31+
</Identifier>
32+
<Content>
33+
<MefComponent>|%CurrentProject%|</MefComponent>
34+
</Content>
35+
</Vsix>

0 commit comments

Comments
 (0)