28 lines
989 B
C#
28 lines
989 B
C#
using ModpackUpdater.Apps.Manager.Api;
|
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
|
using ModpackUpdater.Apps.Manager.LangRes;
|
|
using ModpackUpdater.Apps.Manager.Ui.Models;
|
|
using Pilz.Features;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Features.Tools;
|
|
|
|
internal class ClearDirectLinksFeature : PluginFunction, IPluginFeatureProvider<ClearDirectLinksFeature>
|
|
{
|
|
public static ClearDirectLinksFeature Instance { get; } = new();
|
|
|
|
public ClearDirectLinksFeature() : base(FeatureTypes.Tools, "origin.cleardirectlinks", FeatureNamesLangRes.ClearDirectLinksFeature)
|
|
{
|
|
Icon = AppGlobals.Symbols.GetImage(AppSymbols.broom, Pilz.UI.Symbols.SymbolSize.Small);
|
|
}
|
|
|
|
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is not MainApiParameters p || p.Api.Model.CurrentGridRows is null)
|
|
return null;
|
|
|
|
SharedFunctions.ClearDirectLinks([.. p.Api.Model.CurrentGridRows]);
|
|
|
|
return null;
|
|
}
|
|
}
|