28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using ModpackUpdater.Apps.Manager.Api;
|
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
|
using ModpackUpdater.Apps.Manager.LangRes;
|
|
using Pilz.Features;
|
|
using Pilz.UI.Symbols;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Features.CM;
|
|
|
|
internal class CheckSingleActionHealthyFeature : PluginFunction, IPluginFeatureProvider<CheckSingleActionHealthyFeature>
|
|
{
|
|
public static CheckSingleActionHealthyFeature Instance { get; } = new();
|
|
|
|
public CheckSingleActionHealthyFeature() : base(FeatureTypes.ActionsContextMenu, "origin.checksingleactionhearlthy", FeatureNamesLangRes.CheckSingleActionHealthy)
|
|
{
|
|
Icon = AppGlobals.Symbols.GetImage(AppSymbols.heart_with_pulse, SymbolSize.Small);
|
|
}
|
|
|
|
protected override async Task<object?> ExecuteFunctionAsync(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is not MainApiParameters p || p.Api.Model.SelectedGridRow is not { } row)
|
|
return null;
|
|
|
|
await SharedFunctions.CheckActionHealthy(p.Api, row);
|
|
|
|
return null;
|
|
}
|
|
}
|