28 lines
964 B
C#
28 lines
964 B
C#
using ModpackUpdater.Apps.Manager.Api;
|
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
|
using ModpackUpdater.Apps.Manager.LangRes;
|
|
using ModpackUpdater.Apps.Manager.Ui;
|
|
using Pilz.Features;
|
|
|
|
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, Pilz.UI.Symbols.SymbolSize.Small);
|
|
}
|
|
|
|
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is not MainApiParameters p || p.Api.Model.SelectedGridRow is not { } row)
|
|
return null;
|
|
|
|
SharedFunctions.ClearDirectLinks(row);
|
|
|
|
return null;
|
|
}
|
|
}
|