Skip to content

Commit

Permalink
Merged Upstream/master into SmoothScrollIntoView branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijay-Nirmal committed Jun 21, 2020
2 parents 3884163 + 2800d06 commit d5a7dad
Show file tree
Hide file tree
Showing 329 changed files with 25,813 additions and 2,642 deletions.
89 changes: 89 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,92 @@ dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style
dotnet_naming_style.prefix_private_field_with_underscore.capitalization = camel_case
dotnet_naming_style.prefix_private_field_with_underscore.required_prefix = _

# Code files

# SA1009: Closing parenthesis should be spaced correctly
# Needed for null forgiving operator after functions, "foo()!"
dotnet_diagnostic.SA1009.severity = none

[*.{cs,vb}]

# Migrate back from old Toolkit.ruleset
dotnet_diagnostic.CA1001.severity = warning
dotnet_diagnostic.CA1009.severity = warning
dotnet_diagnostic.CA1016.severity = warning
dotnet_diagnostic.CA1033.severity = warning
dotnet_diagnostic.CA1049.severity = warning
dotnet_diagnostic.CA1060.severity = warning
dotnet_diagnostic.CA1061.severity = warning
dotnet_diagnostic.CA1063.severity = warning
dotnet_diagnostic.CA1065.severity = warning
dotnet_diagnostic.CA1301.severity = warning
dotnet_diagnostic.CA1400.severity = warning
dotnet_diagnostic.CA1401.severity = warning
dotnet_diagnostic.CA1403.severity = warning
dotnet_diagnostic.CA1404.severity = warning
dotnet_diagnostic.CA1405.severity = warning
dotnet_diagnostic.CA1410.severity = warning
dotnet_diagnostic.CA1415.severity = warning
dotnet_diagnostic.CA1821.severity = warning
dotnet_diagnostic.CA1900.severity = warning
dotnet_diagnostic.CA1901.severity = warning
dotnet_diagnostic.CA2002.severity = warning
dotnet_diagnostic.CA2100.severity = warning
dotnet_diagnostic.CA2101.severity = warning
dotnet_diagnostic.CA2108.severity = warning
dotnet_diagnostic.CA2111.severity = warning
dotnet_diagnostic.CA2112.severity = warning
dotnet_diagnostic.CA2114.severity = warning
dotnet_diagnostic.CA2116.severity = warning
dotnet_diagnostic.CA2117.severity = warning
dotnet_diagnostic.CA2122.severity = warning
dotnet_diagnostic.CA2123.severity = warning
dotnet_diagnostic.CA2124.severity = warning
dotnet_diagnostic.CA2126.severity = warning
dotnet_diagnostic.CA2131.severity = warning
dotnet_diagnostic.CA2132.severity = warning
dotnet_diagnostic.CA2133.severity = warning
dotnet_diagnostic.CA2134.severity = warning
dotnet_diagnostic.CA2137.severity = warning
dotnet_diagnostic.CA2138.severity = warning
dotnet_diagnostic.CA2140.severity = warning
dotnet_diagnostic.CA2141.severity = warning
dotnet_diagnostic.CA2146.severity = warning
dotnet_diagnostic.CA2147.severity = warning
dotnet_diagnostic.CA2149.severity = warning
dotnet_diagnostic.CA2200.severity = warning
dotnet_diagnostic.CA2202.severity = warning
dotnet_diagnostic.CA2207.severity = warning
dotnet_diagnostic.CA2212.severity = warning
dotnet_diagnostic.CA2213.severity = warning
dotnet_diagnostic.CA2214.severity = warning
dotnet_diagnostic.CA2216.severity = warning
dotnet_diagnostic.CA2220.severity = warning
dotnet_diagnostic.CA2229.severity = warning
dotnet_diagnostic.CA2231.severity = warning
dotnet_diagnostic.CA2232.severity = warning
dotnet_diagnostic.CA2235.severity = warning
dotnet_diagnostic.CA2236.severity = warning
dotnet_diagnostic.CA2237.severity = warning
dotnet_diagnostic.CA2238.severity = warning
dotnet_diagnostic.CA2240.severity = warning
dotnet_diagnostic.CA2241.severity = warning
dotnet_diagnostic.CA2242.severity = warning
dotnet_diagnostic.SA1011.severity = none
dotnet_diagnostic.SA1101.severity = none
dotnet_diagnostic.SA1118.severity = none
dotnet_diagnostic.SA1200.severity = none
dotnet_diagnostic.SA1201.severity = none
dotnet_diagnostic.SA1202.severity = none
dotnet_diagnostic.SA1309.severity = none
dotnet_diagnostic.SA1310.severity = none
dotnet_diagnostic.SA1600.severity = none
dotnet_diagnostic.SA1602.severity = none
dotnet_diagnostic.SA1611.severity = none
dotnet_diagnostic.SA1633.severity = none
dotnet_diagnostic.SA1634.severity = none
dotnet_diagnostic.SA1652.severity = none

dotnet_diagnostic.SA1629.severity = none # DocumentationTextMustEndWithAPeriod: Let's enable this rule back when we shift to WinUI3 (v8.x). If we do it now, it would mean more than 400 file changes.
dotnet_diagnostic.SA1413.severity = none # UseTrailingCommasInMultiLineInitializers: This would also mean a lot of changes at the end of all multiline intializers. It's also debatable if we want this or not.
dotnet_diagnostic.SA1314.severity = none # TypeParameterNamesMustBeginWithT: We do have a few templates that don't start with T. We need to double check that changing this is not a breaking change. If not, we can re-enable this.
11 changes: 6 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Fixes #
<!-- Link to relevant issue (for ex: #1234) which will automatically close the issue once the PR is merged -->
## Fixes #<!-- Link to relevant issue (for ex: #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one ore more that apply to this PR -->
<!-- Please uncomment one or more that apply to this PR. -->

<!-- - Bugfix -->
<!-- - Feature -->
Expand All @@ -20,6 +21,7 @@ What kind of change does this PR introduce?


## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->


## PR Checklist
Expand All @@ -34,9 +36,8 @@ Please check if your PR fulfills the following requirements:
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes


<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below.
Please note that breaking changes are likely to be rejected -->
Please note that breaking changes are likely to be rejected. -->


## Other information
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,6 @@ msbuild.binlog
*.project.lock.json
/build/tools/**
!/build/tools/packages.config

# Generated file from .ttinclude
**/Generated/TypeInfo.g.cs
10 changes: 10 additions & 0 deletions .runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<MSTest>
<MaxCpuCount>0</MaxCpuCount>
<Parallelize>
<Workers>0</Workers>
<Scope>ClassLevel</Scope>
</Parallelize>
</MSTest>
</RunSettings>
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
14 changes: 9 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<PackageLicenseUrl>https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/license.md</PackageLicenseUrl>
<PackageReleaseNotes>v3.0 release https://github.com/windows-toolkit/WindowsCommunityToolkit/releases</PackageReleaseNotes>
<Copyright>(c) .NET Foundation and Contributors. All rights reserved.</Copyright>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Toolkit.ruleset</CodeAnalysisRuleSet>
<DefaultLanguage>en-US</DefaultLanguage>
<IsDesignProject>$(MSBuildProjectName.Contains('.Design'))</IsDesignProject>
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
Expand All @@ -21,7 +20,7 @@
</PropertyGroup>

<PropertyGroup>
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true'" >true</SignAssembly>
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true' and '$(IsTestSampleProject)' != 'true'" >true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

Expand Down Expand Up @@ -59,11 +58,16 @@
</Choose>

<Choose>
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
<When Condition="'$(IsDesignProject)' != 'true'">
<ItemGroup>
<!--<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.3.83" PrivateAssets="all" />-->
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"/>
</ItemGroup>
</When>
</Choose>

<Choose>
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
<ItemGroup>
<EmbeddedResource Include="**\*.rd.xml" />
<Page Include="**\*.xaml" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
Expand Down
13 changes: 8 additions & 5 deletions GazeInputTest/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using System;
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
Expand All @@ -15,9 +15,10 @@ namespace GazeInputTest
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
public sealed partial class App : Application
{
/// <summary>
/// Initializes a new instance of the <see cref="App"/> class.
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
Expand Down Expand Up @@ -47,7 +48,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
// TODO: Load state from previously suspended application
}

// Place the frame in the current Window
Expand All @@ -63,6 +64,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}

// Ensure the current window is active
Window.Current.Activate();
}
Expand All @@ -75,7 +77,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
Expand All @@ -90,7 +92,8 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity

// TODO: Save application state and stop any background activity
deferral.Complete();
}
}
Expand Down
5 changes: 4 additions & 1 deletion GazeInputTest/GazeInputTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -152,6 +152,9 @@
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.9</Version>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers">
<Version>1.0.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.UWP.Input.GazeInteraction\Microsoft.Toolkit.Uwp.Input.GazeInteraction.vcxproj">
Expand Down
14 changes: 7 additions & 7 deletions GazeInputTest/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using System;
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using Windows.ApplicationModel.Core;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
Expand Down Expand Up @@ -50,18 +50,18 @@ private void ShowCursor_Toggle(object sender, RoutedEventArgs e)
}
}

int clickCount;
private int _clickCount;

private void OnLegacyInvoked(object sender, RoutedEventArgs e)
{
clickCount++;
HowButton.Content = string.Format("{0}: Legacy click", clickCount);
_clickCount++;
HowButton.Content = string.Format("{0}: Legacy click", _clickCount);
}

private void OnGazeInvoked(object sender, DwellInvokedRoutedEventArgs e)
{
clickCount++;
HowButton.Content = string.Format("{0}: Accessible click", clickCount);
_clickCount++;
HowButton.Content = string.Format("{0}: Accessible click", _clickCount);
e.Handled = true;
}

Expand All @@ -71,13 +71,13 @@ private void OnInvokeProgress(object sender, DwellProgressEventArgs e)
{
ProgressShow.Value = 100.0 * e.Progress;
}

ProgressShow.IsIndeterminate = e.State == DwellProgressState.Complete;
e.Handled = true;
}

private async void SpawnClicked(object sender, RoutedEventArgs e)
{

var newView = CoreApplication.CreateNewView();
var newViewId = 0;

Expand Down
Loading

0 comments on commit d5a7dad

Please sign in to comment.