27 lines
946 B
C#
27 lines
946 B
C#
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
|
using ModpackUpdater.Apps.Manager.LangRes;
|
|
using Pilz.Plugins.Advanced;
|
|
using Pilz.UI.Symbols;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Features.Tools;
|
|
|
|
internal class UpdatesCollectorFeature : PluginFunction, IPluginFeatureProvider<UpdatesCollectorFeature>
|
|
{
|
|
public static UpdatesCollectorFeature Instance { get; } = new();
|
|
|
|
public UpdatesCollectorFeature() : base(FeatureTypes.Tools, "origin.updatescollector", FeatureNamesLangRes.UpdatesCollectorFeature)
|
|
{
|
|
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.search, SymbolSize.Small);
|
|
}
|
|
|
|
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is not MainApiParameters p || p.Api.CurWorkspace?.InstallInfos is null)
|
|
return null;
|
|
|
|
SharedFunctions.CollectUpdates(p.Api, [.. p.Api.CurWorkspace.InstallInfos.Actions]);
|
|
|
|
return null;
|
|
}
|
|
}
|