Settingsv2 fix warnings (#2076)

* updating a ton of warnings.

* bunch of cleanup

* few smaller ones

* fixed naming

* reversing an oops

* adjusting json to use attribute

* more json properties
This commit is contained in:
Clint Rutkas
2020-04-10 15:22:07 -07:00
committed by GitHub
parent 3a46f4589b
commit 6fbed4ad5c
55 changed files with 354 additions and 357 deletions

View File

@@ -1,4 +1,7 @@
using System;
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Threading.Tasks;
namespace Microsoft.PowerToys.Settings.UI.Activation
@@ -12,19 +15,19 @@ namespace Microsoft.PowerToys.Settings.UI.Activation
public abstract Task HandleAsync(object args);
}
// Extend this class to implement new ActivationHandlers
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "abstract T and abstract")]
internal abstract class ActivationHandler<T> : ActivationHandler
where T : class
{
public override async Task HandleAsync(object args)
{
await this.HandleInternalAsync(args as T);
await HandleInternalAsync(args as T);
}
public override bool CanHandle(object args)
{
// CanHandle checks the args is of type you have configured
return args is T && this.CanHandleInternal(args as T);
return args is T && CanHandleInternal(args as T);
}
// Override this method to add the activation logic in your activation handler