26 lines
967 B
C#
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 object? ExecuteFunction(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is not MainApiParameters p || p.Api.Model.SelectedGridRow is not { } row)
|
|
return null;
|
|
|
|
Task.Run(() => SharedFunctions.CollectUpdates(p.Api, row.Action)).Wait();
|
|
|
|
return null;
|
|
}
|
|
} |