29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using ModpackUpdater.Apps.Manager.Api;
|
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
|
using ModpackUpdater.Apps.Manager.LangRes;
|
|
using ModpackUpdater.Apps.Manager.Ui.Models.MainWindow;
|
|
using Pilz.Features;
|
|
using Pilz.UI.Symbols;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Features.CM;
|
|
|
|
internal class UpdateDirectLinkFeature : PluginFunction, IPluginFeatureProvider<UpdateDirectLinkFeature>
|
|
{
|
|
public static UpdateDirectLinkFeature Instance { get; } = new();
|
|
|
|
public UpdateDirectLinkFeature() : base(FeatureTypes.ActionsContextMenu, "origin.updatedirectlink", FeatureNamesLangRes.UpdateDirectLinkFeature)
|
|
{
|
|
Icon = AppGlobals.Symbols.GetImage(AppSymbols.renew, SymbolSize.Small);
|
|
}
|
|
|
|
protected override async Task<object?> ExecuteFunctionAsync(PluginFunctionParameter? @params)
|
|
{
|
|
if (@params is not MainApiParameters p || p.Api.Model.SelectedGridRow is not MainWindowGridRow row)
|
|
return null;
|
|
|
|
await SharedFunctions.FindNewDirectLinks(row);
|
|
|
|
return null;
|
|
}
|
|
}
|