Files
minecraft-modpack-updater/ModpackUpdater.Apps.Manager/Features/CM/UpdateCollectorFeature.cs
2025-11-17 07:19:43 +01:00

26 lines
967 B
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 UpdateCollectorFeature : PluginFunction, IPluginFeatureProvider<UpdateCollectorFeature>
{
public static UpdateCollectorFeature Instance { get; } = new();
public UpdateCollectorFeature() : base(FeatureTypes.ActionsContextMenu, "origin.updatecollector", FeatureNamesLangRes.UpdateCollectorFeature)
{
Icon = AppGlobals.Symbols.GetImage(AppSymbols.search, 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.CollectUpdates(p.Api, row.Action);
return null;
}
}