mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
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:
@@ -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
|
||||
|
||||
@@ -28,14 +28,14 @@ namespace Microsoft.PowerToys.Settings.UI.Activation
|
||||
arguments = launchArgs.Arguments;
|
||||
}
|
||||
|
||||
NavigationService.Navigate(this.navElement, arguments);
|
||||
NavigationService.Navigate(navElement, arguments);
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected override bool CanHandleInternal(IActivatedEventArgs args)
|
||||
{
|
||||
// None of the ActivationHandlers has handled the app activation
|
||||
return NavigationService.Frame.Content == null && this.navElement != null;
|
||||
return NavigationService.Frame.Content == null && navElement != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user