mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
* init * Remove unused cache * merge main --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>
38 lines
1.3 KiB
C#
38 lines
1.3 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 Microsoft.CmdPal.Ext.System.Helpers;
|
|
using Microsoft.CommandPalette.Extensions.Toolkit;
|
|
|
|
namespace Microsoft.CmdPal.Ext.System;
|
|
|
|
public sealed partial class EmptyRecycleBinConfirmation : InvokableCommand
|
|
{
|
|
public EmptyRecycleBinConfirmation(bool settingEmptyRBSuccesMsg)
|
|
{
|
|
Name = Resources.Microsoft_plugin_command_name_empty;
|
|
_settingEmptyRBSuccesMsg = settingEmptyRBSuccesMsg;
|
|
}
|
|
|
|
public override CommandResult Invoke()
|
|
{
|
|
if (ResultHelper.ExecutingEmptyRecycleBinTask)
|
|
{
|
|
return CommandResult.ShowToast(new ToastArgs() { Message = Resources.Microsoft_plugin_sys_RecycleBin_EmptyTaskRunning });
|
|
}
|
|
|
|
var confirmArgs = new ConfirmationArgs()
|
|
{
|
|
Title = Resources.Microsoft_plugin_sys_confirmation,
|
|
Description = Resources.EmptyRecycleBin_ConfirmationDialog_Description,
|
|
PrimaryCommand = new EmptyRecycleBinCommand(_settingEmptyRBSuccesMsg),
|
|
IsPrimaryCommandCritical = true,
|
|
};
|
|
|
|
return CommandResult.Confirm(confirmArgs);
|
|
}
|
|
|
|
private bool _settingEmptyRBSuccesMsg;
|
|
}
|