25 lines
946 B
C#
25 lines
946 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 ClearDirectLinkFeature : PluginFunction, IPluginFeatureProvider<ClearDirectLinkFeature>
|
|
{
|
|
public static ClearDirectLinkFeature Instance { get; } = new();
|
|
|
|
public ClearDirectLinkFeature() : base(FeatureTypes.ActionsContextMenu, "origin.cleardirectlink", FeatureNamesLangRes.ClearDirectLinkFeature)
|
|
{
|
|
Icon = AppGlobals.Symbols.GetImage(AppSymbols.broom, SymbolSize.Small);
|
|
}
|
|
|
|
protected override Task<object?> ExecuteFunctionAsync(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is MainApiParameters p && p.Api.Model.SelectedGridRow is { } row)
|
|
SharedFunctions.ClearDirectLinks(p.Api, row);
|
|
return Task.FromResult<object?>(null);
|
|
}
|
|
}
|