Files
PowerToys/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WindowsSettings/Commands/CopySettingCommand.cs
Michael Jolley b552f2ac1e Standardizing built-in extension icon handling (#40606)
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.
2025-07-15 14:33:25 -05:00

40 lines
1.1 KiB
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;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CmdPal.Ext.WindowsSettings.Classes;
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using Windows.ApplicationModel.DataTransfer;
using Windows.Networking.NetworkOperators;
using Windows.UI;
namespace Microsoft.CmdPal.Ext.WindowsSettings.Commands;
internal sealed partial class CopySettingCommand : InvokableCommand
{
private readonly WindowsSetting _entry;
internal CopySettingCommand(WindowsSetting entry)
{
Name = Resources.CopyCommand;
Icon = Icons.CopyIcon;
_entry = entry;
}
public override CommandResult Invoke()
{
ClipboardHelper.SetText(_entry.Command);
return CommandResult.Dismiss();
}
}