Files
minecraft-modpack-updater/ModpackUpdater.Apps.Manager/Features/Tools/CheckAllActionsHealthyFeature.cs
2025-11-15 17:17:52 +01:00

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.Tools;
internal class CheckAllActionsHealthyFeature : PluginFunction, IPluginFeatureProvider<CheckAllActionsHealthyFeature>
{
public static CheckAllActionsHealthyFeature Instance { get; } = new();
public CheckAllActionsHealthyFeature() : base(FeatureTypes.Tools, "origin.checkallactionshearlthy", FeatureNamesLangRes.CheckAllActionsHealthy)
{
Icon = AppGlobals.Symbols.GetImage(AppSymbols.heart_with_pulse, SymbolSize.Small);
}
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
{
if (@params is not MainApiParameters p || p.Api.Model.CurrentGridRows is null)
return null;
Task.Run(() => SharedFunctions.CheckActionHealthy(p.Api, [.. p.Api.Model.CurrentGridRows])).Wait();
return null;
}
}