mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
Just standardizing built-in extensions to use a `internal sealed class Icons` for all their non-dynamic icons. Looks like a LOT of changes, but it's icons all the way down.
39 lines
997 B
C#
39 lines
997 B
C#
// 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.Diagnostics;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.CmdPal.Ext.Apps.Properties;
|
|
using Microsoft.CommandPalette.Extensions.Toolkit;
|
|
|
|
namespace Microsoft.CmdPal.Ext.Apps.Commands;
|
|
|
|
internal sealed partial class OpenPathCommand : InvokableCommand
|
|
{
|
|
private readonly string _target;
|
|
|
|
public OpenPathCommand(string target)
|
|
{
|
|
Name = Resources.open_location;
|
|
Icon = Icons.OpenPathIcon;
|
|
|
|
_target = target;
|
|
}
|
|
|
|
internal static async Task LaunchTarget(string t)
|
|
{
|
|
await Task.Run(() =>
|
|
{
|
|
Process.Start(new ProcessStartInfo(t) { UseShellExecute = true });
|
|
});
|
|
}
|
|
|
|
public override CommandResult Invoke()
|
|
{
|
|
_ = LaunchTarget(_target).ConfigureAwait(false);
|
|
|
|
return CommandResult.Dismiss();
|
|
}
|
|
}
|