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 { 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 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; } }